Number
Overview
A Number represents any 63-bit floating-point number. Internally, all values are encoded as tagged pointers where
pointers with an initial bit of zero denote a floating-point value. As such, it should be noted there will be a
minor loss of precision, approximately 15 decimal digits instead of ~15.95 for a full 64-bit double, with a mantissa
of 51-bits.
Fields
.clamp
fn (minimum?: Number, maximum?: Number) -> NumberEnsures a Number is between two values, otherwise it returns the nearest boundary.
.to_precision
fn (digits?: Number) -> StringConverts a Number to a String with an optional number of significant digits.
.to_scientific
fn (digits?: Number) -> StringConverts a Number to a scientific String representation with an optional number of significant digits.
Statics
.parse
fn (input: String, radix?: Number) -> NumberParses an input String, as a possible Number value. A radix value can be given to ensure parsing integer only values.