support for Decimal.isInfitite and isNan
This commit is contained in:
1 parent
a976702caf
commit
6e9333844e
4 files changed
+36
No files matched your search
@@ -94,6 +94,12 @@ object ObjDecimalSupport {
|
||||
decimalClass.addFn("toReal") {
|
||||
ObjReal.of(valueOf(thisObj).doubleValue(false))
|
||||
}
|
||||
decimalClass.addFn("isInfinite") {
|
||||
ObjFalse
|
||||
}
|
||||
decimalClass.addFn("isNaN") {
|
||||
ObjFalse
|
||||
}
|
||||
decimalClass.addFn("toString") {
|
||||
ObjString(valueOf(thisObj).toStringExpanded())
|
||||
}
|
||||
|
||||
@@ -161,6 +161,10 @@ extern class Decimal() {
|
||||
extern fun toInt(): Int
|
||||
/** Convert to `Real`. */
|
||||
extern fun toReal(): Real
|
||||
/** Return true if this decimal is positive or negative infinity. Always false for Decimal. */
|
||||
extern fun isInfinite(): Bool
|
||||
/** Return true if this decimal is NaN (not a number). Always false for Decimal. */
|
||||
extern fun isNaN(): Bool
|
||||
/**
|
||||
* Convert to a plain decimal string without scientific notation.
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user