BsonDecimal128 class

format 1° bit sign (0 positive - 1 negative) (S) 17 2°-18° Combination field (G)

  • If G0 through G4 are 11111, then the value is NaN regardless of the sign.
    • Furthermore, if G5 is 1, then r is sNaN;otherwise r is qNaN. The remaining bits of G are ignored, and T constitutes the NaN’s payload,which can be used to distinguish various NaNs.
  • If G0 through G4 are 11110 then r and value = (−1)^S×(+∞). The values of the remaining bits in G, andT, are ignored. The two canonical representations of infinity have bits G5 through G16 = 0, and T = 0.
  • For finite numbers, r is (S, E−bias, C) and value = (−1)^S×10^(E−bias)×C, where C is the concatenation of the leading significand digit or bits from the combination field G and the trailing significand field T, and where the biased exponent E is encoded in the combination field.
    • If G0 and G1 together are one of 00, 01, or 10, then the biased exponent E is formed from G0 through G13 (Gw+1) and the significand is formed from bits G14 (Gw+2) through the end of the encoding (including T).
    • If G0 and G1 together are 11 and G2 and G3 together are one of 00, 01, or 10, then the biased exponent E is formed from G2 through G15 (Gw+3) and the significand is formed by prefixing the 4 bits "100 + G16" (8+Gw+4) to T. 110 19°-128° trailing significand field (T)
Inheritance

Properties

bin BsonBinary
getter/setter pair
hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
typeByte int
no setteroverride
value → Decimal?
no setteroverride

Methods

byteLength() int
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
packElement(String? name, BsonBinary buffer) → void
inherited
packValue(BsonBinary buffer) → void
override
toHexString() String
toJson() String
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

convertBinaryToDecimal(BsonBinary binary) → Decimal?
convertDecimalToBinary(Decimal? decimal) BsonBinary
extractData(BsonBinary buffer) BsonBinary
extractExponent(String valueString) int
extractSignificand(String valueString) → Decimal
parse(String hexString) BsonDecimal128
removeTrailingZeros(String valueString) String