Crates.io | near-decimal |
lib.rs | near-decimal |
version | 2.2.0 |
source | src |
created_at | 2022-01-06 15:31:22.139803 |
updated_at | 2022-01-07 12:19:24.648738 |
description | Decimal floating point arithmetic for Rust |
homepage | |
repository | https://github.com/dmstjd0182/near-decimal |
max_upload_size | |
id | 509017 |
size | 5,461,658 |
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!
.
let x = d128!(1.234);
let y = d128!(1.111);
let z = d128!(2.345);
assert_eq(x + y, z);