struct BigDecimal
- BigDecimal
- Number
- Value
- Object
Overview
A BigDecimal
can represent arbitrarily large precision decimals.
It is internally represented by a pair of BigInt
and UInt64
: value and scale.
Value contains the actual value, and scale tells the decimal point place.
E.g. when value is 1234
and scale 2
, the result is 12.34
.
NOTE To use BigDecimal
, you must explicitly import it with require "big"
The general idea and some of the arithmetic algorithms were adapted from the MIT/APACHE-licensed bigdecimal-rs.
Included Modules
- Comparable(BigDecimal)
- Comparable(BigRational)
- Comparable(Float)
- Comparable(Int)
Defined in:
big.crConstructors
- .from_con(value, pull : CON::PullParser) : BigDecimal
- .from_con(pull : CON::PullParser) : BigDecimal
Instance methods inherited from struct Value
==(other : CON::Any)
==
Instance methods inherited from class Object
===(other : CON::Any)
===,
from_con(con : String | IO)
from_con,
to_con(io : IO)to_con to_con, to_pretty_con(indent : String = " ")
to_pretty_con(io : IO, indent : String = " ") to_pretty_con