Open binkley opened 2 years ago
Note that internally FloatingBigRational
is still the ratio of two BigInteger
s, not two BigDecimals
. Option 2 would imply:
println(FixedBigRational.valueOf(2))
println(FloatingBigRational.valueOf(2))
prints:
3/2
3.0/2.0
There are challenges when using
BigDecimal
and constructors such asBigDecimal(Double)
vsBigDecimal(String)
. For example:BigDecimal(1.0)
has different "scale" thanBigDecimal("1.0")
Design & implement a consistent policy for
FloatingBigRational
. Options may include:BigDecimal
Present code leans towards the former (partly by accident).