Packages

case class Real(hi: Double, lo: Double = 0.0) extends Fractional[Real] with Ordered[Real] with Product with Serializable

The Real class provides higher precision floating point numbers using the Double Double technique, which supports 106 bits of precision. ----------------------------------------------------------------------------- Code adapted from DoubleDouble.java:

hi

the high portion of the real number

lo

the low portion of the real number

See also

http://tsusiatsoftware.net/dd/main.html

oai.cwi.nl/oai/asset/9159/9159A.pdf -----------------------------------------------------------------------------

Linear Supertypes
Product, Equals, Ordered[Real], Comparable[Real], Fractional[Real], Numeric[Real], Ordering[Real], PartialOrdering[Real], Equiv[Real], Serializable, Comparator[Real], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Real
  2. Product
  3. Equals
  4. Ordered
  5. Comparable
  6. Fractional
  7. Numeric
  8. Ordering
  9. PartialOrdering
  10. Equiv
  11. Serializable
  12. Comparator
  13. AnyRef
  14. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Real(hi: Double, lo: Double = 0.0)

    hi

    the high portion of the real number

    lo

    the low portion of the real number

Type Members

  1. class FractionalOps extends scala.math.Fractional.NumericOps
    Definition Classes
    Fractional
  2. class NumericOps extends AnyRef
    Definition Classes
    Numeric
  3. class OrderingOps extends AnyRef
    Definition Classes
    Ordering

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. def !=~(y: Real): Boolean

    Return whether two real numbers are not nearly equal.

    Return whether two real numbers are not nearly equal.

    y

    the compare 'this' with y

  3. final def ##: Int
    Definition Classes
    AnyRef → Any
  4. def %(x: Real): Real

    Compute the remainder of the 'this' divided by 'x', i.e., 'this mod x'.

    Compute the remainder of the 'this' divided by 'x', i.e., 'this mod x'.

    x

    the modulus

  5. def *(y: Real): Real

    Multiply two real numbers.

    Multiply two real numbers.

    y

    multiply this times y

  6. def +(y: Real): Real

    Add two real numbers.

    Add two real numbers.

    y

    add real y to this

  7. def -(y: Real): Real

    Subtract two real numbers.

    Subtract two real numbers.

    y

    subtract y from this

  8. def /(y: Real): Real

    Divide two real numbers.

    Divide two real numbers.

    y

    divide this by y

  9. def <(that: Real): Boolean
    Definition Classes
    Ordered
  10. def <=(that: Real): Boolean
    Definition Classes
    Ordered
  11. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  12. def =~(y: Real): Boolean

    Return whether two real numbers are nearly equal.

    Return whether two real numbers are nearly equal.

    y

    the compare 'this' with y

  13. def >(that: Real): Boolean
    Definition Classes
    Ordered
  14. def >=(that: Real): Boolean
    Definition Classes
    Ordered
  15. def abs: Real

    Return the absolute value of 'this' real number.

  16. def abs(x: Real): Real
    Definition Classes
    Numeric
  17. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  18. def ceil: Real

    Return the 'ceil'ing (integer above) of 'this' real number.

  19. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  20. def compare(y: Real): Int

    Compare 'this' real number with that real number 'y'.

    Compare 'this' real number with that real number 'y'.

    y

    that real number

    Definition Classes
    Real → Ordered
  21. def compare(x: Real, y: Real): Int

    Compare two real numbers (negative for <, zero for ==, positive for >).

    Compare two real numbers (negative for <, zero for ==, positive for >).

    x

    the first real number to compare

    y

    the second real number to compare

    Definition Classes
    Real → Ordering → Comparator
  22. def compareTo(that: Real): Int
    Definition Classes
    Ordered → Comparable
  23. def div(x: Real, y: Real): Real
    Definition Classes
    Real → Fractional
  24. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  25. def equals(x: Any): Boolean

    Override equals to determine whether 'this' real number equals real 'y'.

    Override equals to determine whether 'this' real number equals real 'y'.

    Definition Classes
    Real → Equals → Comparator → AnyRef → Any
  26. def equiv(x: Real, y: Real): Boolean
    Definition Classes
    Ordering → PartialOrdering → Equiv
  27. def floor: Real

    Return the floor (integer below) of 'this' real number.

  28. def fromInt(x: Int): Real

    Create a real number from an Int.

    Create a real number from an Int.

    Definition Classes
    Real → Numeric
  29. def fromLong(x: Long): Real

    Create a real number from an Long.

  30. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  31. def gt(x: Real, y: Real): Boolean
    Definition Classes
    Ordering → PartialOrdering
  32. def gteq(x: Real, y: Real): Boolean
    Definition Classes
    Ordering → PartialOrdering
  33. def hashCode(): Int

    Must also override hashCode to be be compatible with equals.

    Must also override hashCode to be be compatible with equals.

    Definition Classes
    Real → AnyRef → Any
  34. val hi: Double
  35. def in(set: Set[Real]): Boolean

    Determine whether 'this' is in the given set.

  36. def in(lim: (Real, Real)): Boolean

    Determine whether 'this' is within the given bounds

    Determine whether 'this' is within the given bounds

    lim

    the given (lower, upper) bounds

  37. def isInfinity: Boolean

    Determine whether 'this' number "is Infinite".

  38. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  39. def isNaN: Boolean

    Determine whether 'this' number "is Not a Number".

  40. def isReverseOf(other: Ordering[_]): Boolean
    Definition Classes
    Ordering
  41. val lo: Double
  42. def lt(x: Real, y: Real): Boolean
    Definition Classes
    Ordering → PartialOrdering
  43. def lteq(x: Real, y: Real): Boolean
    Definition Classes
    Ordering → PartialOrdering
  44. def max(y: Real): Real

    Return the maximum of 'this' and that real numbers.

    Return the maximum of 'this' and that real numbers.

    y

    that real number to compare with this

  45. def max[U <: Real](x: U, y: U): U
    Definition Classes
    Ordering
  46. def min(y: Real): Real

    Return the minimum of 'this' and that real numbers.

    Return the minimum of 'this' and that real numbers.

    y

    that real number to compare with this

  47. def min[U <: Real](x: U, y: U): U
    Definition Classes
    Ordering
  48. def minus(x: Real, y: Real): Real
    Definition Classes
    Real → Numeric
  49. implicit def mkNumericOps(lhs: Real): FractionalOps
    Definition Classes
    Fractional → Numeric
  50. implicit def mkOrderingOps(lhs: Real): OrderingOps
    Definition Classes
    Ordering
  51. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  52. def near_eq(x: Real, y: Real): Boolean
  53. def negate(x: Real): Real
    Definition Classes
    Real → Numeric
  54. def not_in(set: Set[Real]): Boolean

    Determine whether 'this' is not in the given set.

  55. def not_in(lim: (Real, Real)): Boolean

    Determine whether 'this' is not within the given bounds

    Determine whether 'this' is not within the given bounds

    lim

    the given (lower, upper) bounds

  56. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  57. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  58. def on[U](f: (U) => Real): Ordering[U]
    Definition Classes
    Ordering
  59. def one: Real
    Definition Classes
    Numeric
  60. def orElse(other: Ordering[Real]): Ordering[Real]
    Definition Classes
    Ordering
  61. def orElseBy[S](f: (Real) => S)(implicit ord: Ordering[S]): Ordering[Real]
    Definition Classes
    Ordering
  62. def parseString(str: String): Option[Real]

    Parse the string to create a real number.

    Parse the string to create a real number.

    Definition Classes
    Real → Numeric
  63. def plus(x: Real, y: Real): Real
    Definition Classes
    Real → Numeric
  64. def pow(x: Real, y: Real): Real
  65. def pow(x: Real, k: Int): Real
  66. def productElementNames: Iterator[String]
    Definition Classes
    Product
  67. def rem(x: Real, y: Real): Real
  68. def reverse: Ordering[Real]
    Definition Classes
    Ordering → PartialOrdering
  69. def reversed(): Comparator[Real]
    Definition Classes
    Comparator
  70. def round: Long

    Return the 'round'ed (closest) integer to 'this' real number.

  71. def sign(x: Real): Real
    Definition Classes
    Numeric
  72. def signum: Real

    Return the signum of 'this' real number, 1, 0, -1 for >0, =0, <0.

  73. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  74. def thenComparing[U <: Comparable[_ >: U <: AnyRef]](arg0: Function[_ >: Real <: AnyRef, _ <: U]): Comparator[Real]
    Definition Classes
    Comparator
  75. def thenComparing[U <: AnyRef](arg0: Function[_ >: Real <: AnyRef, _ <: U], arg1: Comparator[_ >: U <: AnyRef]): Comparator[Real]
    Definition Classes
    Comparator
  76. def thenComparing(arg0: Comparator[_ >: Real <: AnyRef]): Comparator[Real]
    Definition Classes
    Comparator
  77. def thenComparingDouble(arg0: ToDoubleFunction[_ >: Real <: AnyRef]): Comparator[Real]
    Definition Classes
    Comparator
  78. def thenComparingInt(arg0: ToIntFunction[_ >: Real <: AnyRef]): Comparator[Real]
    Definition Classes
    Comparator
  79. def thenComparingLong(arg0: ToLongFunction[_ >: Real <: AnyRef]): Comparator[Real]
    Definition Classes
    Comparator
  80. def times(x: Real, y: Real): Real
    Definition Classes
    Real → Numeric
  81. def toDouble: Double
  82. def toDouble(x: Real): Double

    Convert that/'this' real number to a Double.

    Convert that/'this' real number to a Double.

    x

    that real number to convert

    Definition Classes
    Real → Numeric
  83. def toFloat: Float
  84. def toFloat(x: Real): Float

    Convert that/'this' real number to a Float.

    Convert that/'this' real number to a Float.

    x

    that real number to convert

    Definition Classes
    Real → Numeric
  85. def toInt: Int
  86. def toInt(x: Real): Int

    Convert that/'this' real number to an Int.

    Convert that/'this' real number to an Int.

    x

    that real number to convert

    Definition Classes
    Real → Numeric
  87. def toLong: Long
  88. def toLong(x: Real): Long

    Convert 'this' real number to a Long.

    Convert 'this' real number to a Long.

    x

    that real number to convert

    Definition Classes
    Real → Numeric
  89. def toReal: Real
  90. def toReal(x: Real): Real

    Convert that/'this' real number to a Real.

    Convert that/'this' real number to a Real.

    x

    that real number to convert

  91. def toString(): String

    Convert 'this' real number to a String in standard form "dd.dd".

    Convert 'this' real number to a String in standard form "dd.dd". FIX: add support for scientific notation

    Definition Classes
    Real → AnyRef → Any
  92. def toString2: String

    Convert 'this' real number to a String of the form "(hi, lo)".

  93. def tryCompare(x: Real, y: Real): Some[Int]
    Definition Classes
    Ordering → PartialOrdering
  94. def unary_-: Real

    Compute the unary minus (-).

  95. val val1: Double

    General alias for the parts of a real number

  96. val val2: Double

    General alias for the parts of a real number

  97. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  98. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  99. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  100. def zero: Real
    Definition Classes
    Numeric
  101. def ~^(y: Real): Real

    Raise a real number to the 'k'-th power.

    Raise a real number to the 'k'-th power.

    y

    the power/exponent (as a Real)

  102. def ~^(k: Int): Real

    Raise a real number to the 'k'-th power.

    Raise a real number to the 'k'-th power.

    k

    the power/exponent (as a Int)

  103. def (y: Real): Real
  104. def (set: Set[Real]): Boolean
  105. def (lim: (Real, Real)): Boolean
  106. def (set: Set[Real]): Boolean
  107. def (lim: (Real, Real)): Boolean
  108. def (y: Real): Boolean
  109. def (y: Real): Boolean
  110. def (y: Real): Boolean

    Compare 'this' real number with that real number 'y' for inequality.

    Compare 'this' real number with that real number 'y' for inequality.

    y

    that real number

  111. def (y: Real): Boolean

    Compare 'this' real number with that real number 'y' for less than or equal to.

    Compare 'this' real number with that real number 'y' for less than or equal to.

    y

    that real number

  112. def (y: Real): Boolean

    Compare 'this' real number with that real number 'y' for greater than or equal to.

    Compare 'this' real number with that real number 'y' for greater than or equal to.

    y

    that real number

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated
  2. def signum(x: Real): Int
    Definition Classes
    Numeric
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) use sign method instead

Inherited from Product

Inherited from Equals

Inherited from Ordered[Real]

Inherited from Comparable[Real]

Inherited from Fractional[Real]

Inherited from Numeric[Real]

Inherited from Ordering[Real]

Inherited from PartialOrdering[Real]

Inherited from Equiv[Real]

Inherited from Serializable

Inherited from Comparator[Real]

Inherited from AnyRef

Inherited from Any

Ungrouped