final
class
FixedPoint extends AnyVal
Instance Constructors
-
new
FixedPoint(long: Long)
Value Members
-
def
!=(rhs: FixedPoint): Boolean
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
-
-
-
-
-
-
-
-
-
-
-
-
-
def
<(rhs: FixedPoint): Boolean
-
def
<=(rhs: FixedPoint): Boolean
-
def
==(rhs: FixedPoint): Boolean
-
final
def
==(arg0: Any): Boolean
-
def
>(rhs: FixedPoint): Boolean
-
def
>=(rhs: FixedPoint): Boolean
-
-
final
def
asInstanceOf[T0]: T0
-
-
def
compare(rhs: FixedPoint): Int
-
-
-
-
def
getClass(): Class[_ <: AnyVal]
-
final
def
isInstanceOf[T0]: Boolean
-
def
isWhole(implicit scale: FixedScale): Boolean
-
val
long: Long
-
-
-
-
def
signum: Int
-
-
def
toBigDecimal(implicit scale: FixedScale): BigDecimal
-
def
toDouble(implicit scale: FixedScale): Double
-
def
toLong(implicit scale: FixedScale): Long
-
-
def
toString(implicit scale: FixedScale): String
-
def
toString(): String
-
Inherited from AnyVal
Inherited from NotNull
Inherited from Any
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