2.2.0 Jan 7, 2022
2.1.0 Jan 6, 2022

#23 in #128-bit

Apache-2.0

1MB
11K SLoC

C 10K SLoC // 0.4% comments Rust 1K SLoC // 0.0% comments

near-decimal

Travis Downloads Crates.io Apache license

Decimal Floating Point arithmetic for rust-NEAR based on the decNumber library.

The library provides d128 which is a 128-bit decimal floating point number. You can use it as other primitive numbers in Rust. All operators are overloaded to allow ergonomic use of this type.

To emulate literals a macro is used d128!.

Documentation

Example

let x = d128!(1.234);
let y = d128!(1.111);
let z = d128!(2.345);
assert_eq(x + y, z);

Dependencies

~12MB
~211K SLoC