MCPcopy Create free account
hub / github.com/apache/fory / NewDecimal

Function NewDecimal

go/fory/decimal.go:33–39  ·  view source on GitHub ↗
(unscaled *big.Int, scale int32)

Source from the content-addressed store, hash-verified

31}
32
33func NewDecimal(unscaled *big.Int, scale int32) Decimal {
34 var copied big.Int
35 if unscaled != nil {
36 copied.Set(unscaled)
37 }
38 return Decimal{Unscaled: copied, Scale: scale}
39}
40
41func (d Decimal) Equal(other Decimal) bool {
42 return d.Scale == other.Scale && d.Unscaled.Cmp(&other.Unscaled) == 0

Callers 8

compatibleValueToDecimalFunction · 0.85
canonicalDecimalFromRatFunction · 0.85
mustDecimalFunction · 0.85
TestDecimalRoundTripFunction · 0.85
TestDecimalWireEncodingFunction · 0.85
ReadDataMethod · 0.85

Calls 1

SetMethod · 0.45

Tested by 4

mustDecimalFunction · 0.68
TestDecimalRoundTripFunction · 0.68
TestDecimalWireEncodingFunction · 0.68