spire.math

FixedPoint

final class FixedPoint extends AnyVal

FixedPoint is a value class that provides fixed point arithmetic operations (using an implicit denominator) to unboxed Long values.

Working with FixedPoint values is similar to other fractional types, except that most operations require an implicit FixedScale instance (which provides the denominator).

For example:

// interpret FixedPoint(n) as n/1000 implicit val scale = FixedScale(1000)

// these three values are equivalent val a = FixedPoint("12.345") // decimal repr val b = FixedPoint(Rational(2469, 200)) // fraction repr val c = new FixedPoint(12345L) // "raw" repr

Self Type
FixedPoint
Linear Supertypes
AnyVal, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. FixedPoint
  2. AnyVal
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new FixedPoint(long: Long)

Value Members

  1. def !=(rhs: FixedPoint): Boolean

  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    Any
  4. def %(rhs: Long)(implicit scale: FixedScale): FixedPoint

  5. def %(rhs: FixedPoint): FixedPoint

  6. def *(rhs: Long): FixedPoint

  7. def *(rhs: FixedPoint)(implicit scale: FixedScale): FixedPoint

  8. def **(k: Int)(implicit scale: FixedScale): FixedPoint

  9. def +(rhs: Long)(implicit scale: FixedScale): FixedPoint

  10. def +(rhs: FixedPoint): FixedPoint

  11. def -(rhs: Long)(implicit scale: FixedScale): FixedPoint

  12. def -(rhs: FixedPoint): FixedPoint

  13. def /(rhs: Long): FixedPoint

  14. def /(rhs: FixedPoint)(implicit scale: FixedScale): FixedPoint

  15. def /%(rhs: FixedPoint)(implicit scale: FixedScale): (FixedPoint, FixedPoint)

  16. def /~(rhs: FixedPoint)(implicit scale: FixedScale): FixedPoint

  17. def <(rhs: FixedPoint): Boolean

  18. def <=(rhs: FixedPoint): Boolean

  19. def ==(rhs: FixedPoint): Boolean

  20. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  21. def >(rhs: FixedPoint): Boolean

  22. def >=(rhs: FixedPoint): Boolean

  23. def abs: FixedPoint

  24. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  25. def ceil(implicit scale: FixedScale): FixedPoint

  26. def compare(rhs: FixedPoint): Int

  27. def floor(implicit scale: FixedScale): FixedPoint

  28. def fpow(y: FixedPoint)(implicit scale: FixedScale): FixedPoint

  29. def gcd(rhs: FixedPoint): FixedPoint

  30. def getClass(): Class[_ <: AnyVal]

    Definition Classes
    AnyVal → Any
  31. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  32. def isWhole(implicit scale: FixedScale): Boolean

  33. val long: Long

  34. def nroot(k: Int)(implicit scale: FixedScale): FixedPoint

  35. def pow(k: Int)(implicit scale: FixedScale): FixedPoint

  36. def round(implicit scale: FixedScale): FixedPoint

  37. def signum: Int

  38. def sqrt(implicit scale: FixedScale): FixedPoint

  39. def toBigDecimal(implicit scale: FixedScale): BigDecimal

  40. def toDouble(implicit scale: FixedScale): Double

  41. def toLong(implicit scale: FixedScale): Long

  42. def toRational(implicit scale: FixedScale): Rational

  43. def toString(implicit scale: FixedScale): String

  44. def toString(): String

    Definition Classes
    FixedPoint → Any
  45. def unary_-(): FixedPoint

Inherited from AnyVal

Inherited from Any

Ungrouped