Replace f64 w/ d128: higher accuracy / precision
Closes #17 (closed)
128-bit decimal floats have significantly higher accuracy and precision than what 64-bit floating point arithmetic can provide. 128-bit decimals provide up to 34 decimal digits of precision, and their calculations are precise within that range, due to making these calculations using ALUs, rather than on a FPU.
This will immediately make calc useful for real world use in any area that requires accurate decimal precision, such as financial calculations. Arbitrary precision decimal math would be more ideal, but the Rust ecosystem does not yet provide support for a BigDecimal
type at this time.
A downside to this PR, however, is that the d128
type from the decimal crate does not yet implement the Float
trait, and thus it doesn't have access to cos()
, sin()
, and tan()
methods. So, this PR disables them for now.