Class/Object

spire.math.extras

FixedPoint

Related Docs: object FixedPoint | package extras

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): FixedPoint

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Permalink
  20. def abs: FixedPoint

    Permalink
  21. final def asInstanceOf[T0]: T0

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

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

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

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

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

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

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

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

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

    Permalink
  31. val long: Long

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

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

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

    Permalink
  35. def signum: Int

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

    Permalink
  37. def tmod(rhs: Long)(implicit scale: FixedScale): FixedPoint

    Permalink
  38. def tmod(rhs: FixedPoint): FixedPoint

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

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

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

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

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

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

    Permalink
  45. def toString(): String

    Permalink
    Definition Classes
    FixedPoint → Any
  46. def tquot(rhs: FixedPoint)(implicit scale: FixedScale): FixedPoint

    Permalink
  47. def tquotmod(rhs: FixedPoint)(implicit scale: FixedScale): (FixedPoint, FixedPoint)

    Permalink
  48. def unary_-(): FixedPoint

    Permalink

Inherited from AnyVal

Inherited from Any

Ungrouped