Pallas Math
Fixed-precision arithmetic for the parts of the Cardano protocol that need
to compute ln, exp, and pow to high precision — most notably the
reward and pool-saturation calculations. Backed by dashu for the
underlying big-integer representation.
Usage
use ;
let x = from_str?; // 2.0 with 34 fractional digits
let y = x.ln; // ≈ 0.6931471805599453…
println!;
Overview
math— the public surface:FixedDecimal(the fixed-precision number type) and theFixedPrecisiontrait it implements (new,from_str,precision,exp,ln,pow,exp_cmp,round/floor/ceil/trunc).math_dashu—dashu-backed implementation thatFixedDecimalaliases.DEFAULT_PRECISION(34), and the lazyZERO/ONE/MINUS_ONEconstants for convenience.