BSON::Decimal128
128-bit decimal floating point.
See: https://github.com/mongodb/specifications/blob/master/source/bson-decimal128/decimal128.rst
Constants
EXPONENT_OFFSET = 6176
Exponent offset.
INFINITY_MASK = 8646911284551352320_u64
Infinity mask.
INFINITY_STRING = "Infinity"
String representing an Infinity value.
MAX_DIGITS_OF_PRECISION = 34
Maximum digits of precision.
MAX_EXPONENT = 6111
Maximum exponent.
MIN_EXPONENT = -6176
Minimum exponent.
NAN_MASK = 8935141660703064064_u64
NaN mask.
NAN_STRING = "NaN"
String representing a NaN value.
SIGN_BIT_MASK = 1_u64 << 63
Signed bit mask.
SNAN_MASK = 1_u64 << 57
SNaN mask.
TWO_HIGHEST_BITS_SET = 3_u64 << 61
The two highest bits of the 64 high order bits.
Constructors
Convert parts representing a Decimal128 into the corresponding bits.
new(big_decimal : BigDecimal)
SourceInstance methods
high
Sourceinfinity?
Sourcelow
Sourcenan?
Sourcenegative?
Sourceto_big_d
Sourceto_canonical_extjson(builder : JSON::Builder)
Serialize to a canonical extended json representation.
Write BSON byte representation directly to an IO.
to_json(builder : JSON::Builder)
Source