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 -----------------------------------------------------------------------------
- Alphabetic
- By Inheritance
- Real
- Product
- Equals
- Ordered
- Comparable
- Fractional
- Numeric
- Ordering
- PartialOrdering
- Equiv
- Serializable
- Comparator
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- 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
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- 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
- final def ##: Int
- Definition Classes
- AnyRef → Any
- 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
- def *(y: Real): Real
Multiply two real numbers.
Multiply two real numbers.
- y
multiply this times y
- def +(y: Real): Real
Add two real numbers.
Add two real numbers.
- y
add real y to this
- def -(y: Real): Real
Subtract two real numbers.
Subtract two real numbers.
- y
subtract y from this
- def /(y: Real): Real
Divide two real numbers.
Divide two real numbers.
- y
divide this by y
- def <(that: Real): Boolean
- Definition Classes
- Ordered
- def <=(that: Real): Boolean
- Definition Classes
- Ordered
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- 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
- def >(that: Real): Boolean
- Definition Classes
- Ordered
- def >=(that: Real): Boolean
- Definition Classes
- Ordered
- def abs: Real
Return the absolute value of 'this' real number.
- def abs(x: Real): Real
- Definition Classes
- Numeric
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def ceil: Real
Return the 'ceil'ing (integer above) of 'this' real number.
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- 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
- 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
- def compareTo(that: Real): Int
- Definition Classes
- Ordered → Comparable
- def div(x: Real, y: Real): Real
- Definition Classes
- Real → Fractional
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- 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
- def equiv(x: Real, y: Real): Boolean
- Definition Classes
- Ordering → PartialOrdering → Equiv
- def floor: Real
Return the floor (integer below) of 'this' real number.
- def fromInt(x: Int): Real
Create a real number from an
Int
.Create a real number from an
Int
.- Definition Classes
- Real → Numeric
- def fromLong(x: Long): Real
Create a real number from an
Long
. - final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def gt(x: Real, y: Real): Boolean
- Definition Classes
- Ordering → PartialOrdering
- def gteq(x: Real, y: Real): Boolean
- Definition Classes
- Ordering → PartialOrdering
- 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
- val hi: Double
- def in(set: Set[Real]): Boolean
Determine whether 'this' is in the given set.
- 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
- def isInfinity: Boolean
Determine whether 'this' number "is Infinite".
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isNaN: Boolean
Determine whether 'this' number "is Not a Number".
- def isReverseOf(other: Ordering[_]): Boolean
- Definition Classes
- Ordering
- val lo: Double
- def lt(x: Real, y: Real): Boolean
- Definition Classes
- Ordering → PartialOrdering
- def lteq(x: Real, y: Real): Boolean
- Definition Classes
- Ordering → PartialOrdering
- 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
- def max[U <: Real](x: U, y: U): U
- Definition Classes
- Ordering
- 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
- def min[U <: Real](x: U, y: U): U
- Definition Classes
- Ordering
- def minus(x: Real, y: Real): Real
- Definition Classes
- Real → Numeric
- implicit def mkNumericOps(lhs: Real): FractionalOps
- Definition Classes
- Fractional → Numeric
- implicit def mkOrderingOps(lhs: Real): OrderingOps
- Definition Classes
- Ordering
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def near_eq(x: Real, y: Real): Boolean
- def negate(x: Real): Real
- Definition Classes
- Real → Numeric
- def not_in(set: Set[Real]): Boolean
Determine whether 'this' is not in the given set.
- 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
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def on[U](f: (U) => Real): Ordering[U]
- Definition Classes
- Ordering
- def one: Real
- Definition Classes
- Numeric
- def orElse(other: Ordering[Real]): Ordering[Real]
- Definition Classes
- Ordering
- def orElseBy[S](f: (Real) => S)(implicit ord: Ordering[S]): Ordering[Real]
- Definition Classes
- Ordering
- 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
- def plus(x: Real, y: Real): Real
- Definition Classes
- Real → Numeric
- def pow(x: Real, y: Real): Real
- def pow(x: Real, k: Int): Real
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- def rem(x: Real, y: Real): Real
- def reverse: Ordering[Real]
- Definition Classes
- Ordering → PartialOrdering
- def reversed(): Comparator[Real]
- Definition Classes
- Comparator
- def round: Long
Return the 'round'ed (closest) integer to 'this' real number.
- def sign(x: Real): Real
- Definition Classes
- Numeric
- def signum: Real
Return the signum of 'this' real number, 1, 0, -1 for >0, =0, <0.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def thenComparing[U <: Comparable[_ >: U <: AnyRef]](arg0: Function[_ >: Real <: AnyRef, _ <: U]): Comparator[Real]
- Definition Classes
- Comparator
- def thenComparing[U <: AnyRef](arg0: Function[_ >: Real <: AnyRef, _ <: U], arg1: Comparator[_ >: U <: AnyRef]): Comparator[Real]
- Definition Classes
- Comparator
- def thenComparing(arg0: Comparator[_ >: Real <: AnyRef]): Comparator[Real]
- Definition Classes
- Comparator
- def thenComparingDouble(arg0: ToDoubleFunction[_ >: Real <: AnyRef]): Comparator[Real]
- Definition Classes
- Comparator
- def thenComparingInt(arg0: ToIntFunction[_ >: Real <: AnyRef]): Comparator[Real]
- Definition Classes
- Comparator
- def thenComparingLong(arg0: ToLongFunction[_ >: Real <: AnyRef]): Comparator[Real]
- Definition Classes
- Comparator
- def times(x: Real, y: Real): Real
- Definition Classes
- Real → Numeric
- def toDouble: Double
- 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
- def toFloat: Float
- 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
- def toInt: Int
- 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
- def toLong: Long
- def toLong(x: Real): Long
Convert 'this' real number to a
Long
. - def toReal: Real
- 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
- 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
- def toString2: String
Convert 'this' real number to a String of the form "(hi, lo)".
- def tryCompare(x: Real, y: Real): Some[Int]
- Definition Classes
- Ordering → PartialOrdering
- def unary_-: Real
Compute the unary minus (-).
- val val1: Double
General alias for the parts of a real number
- val val2: Double
General alias for the parts of a real number
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def zero: Real
- Definition Classes
- Numeric
- 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
)
- 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
)
- def ↑(y: Real): Real
- def ∈(set: Set[Real]): Boolean
- def ∈(lim: (Real, Real)): Boolean
- def ∉(set: Set[Real]): Boolean
- def ∉(lim: (Real, Real)): Boolean
- def ≈(y: Real): Boolean
- def ≉(y: Real): Boolean
- 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
- 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
- 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