Class/Object

spire.math

FixedPoint

Related Docs: object FixedPoint | package math

Permalink

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
Visibility
  1. Public
  2. All

Instance Constructors

  1. new FixedPoint(long: Long)

    Permalink

Value Members

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

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

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

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

    Permalink
  5. def %(rhs: FixedPoint): FixedPoint

    Permalink
  6. def *(rhs: Long): FixedPoint

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

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

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

    Permalink
  10. def +(rhs: FixedPoint): FixedPoint

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

    Permalink
  12. def -(rhs: FixedPoint): FixedPoint

    Permalink
  13. def /(rhs: Long): FixedPoint

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

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

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

    Permalink
  17. def <(rhs: FixedPoint): Boolean

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

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

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

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

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

    Permalink
  23. def >=(rhs: FixedPoint): Boolean

    Permalink
  24. def abs: FixedPoint

    Permalink
  25. final def asInstanceOf[T0]: T0

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

    Permalink
  27. def compare(rhs: FixedPoint): Int

    Permalink
  28. def floor(implicit scale: FixedScale): FixedPoint

    Permalink
  29. def fpow(k: FixedPoint)(implicit scale: FixedScale): FixedPoint

    Permalink
  30. def gcd(rhs: FixedPoint): FixedPoint

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

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

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

    Permalink
  34. val long: Long

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

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

    Permalink
  37. def round(implicit scale: FixedScale): FixedPoint

    Permalink
  38. def signum: Int

    Permalink
  39. def sqrt(implicit scale: FixedScale): FixedPoint

    Permalink
  40. def toBigDecimal(implicit scale: FixedScale): BigDecimal

    Permalink
  41. def toDouble(implicit scale: FixedScale): Double

    Permalink
  42. def toLong(implicit scale: FixedScale): Long

    Permalink
  43. def toRational(implicit scale: FixedScale): Rational

    Permalink
  44. def toReal(implicit scale: FixedScale): Real

    Permalink
  45. def toString(implicit scale: FixedScale): String

    Permalink
  46. def toString(): String

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

    Permalink

Inherited from AnyVal

Inherited from Any

Ungrouped