Crates.io | decimal |
lib.rs | decimal |
version | 2.1.0 |
source | src |
created_at | 2015-12-11 21:10:00.967956 |
updated_at | 2021-03-08 13:43:19.007571 |
description | Decimal floating point arithmetic for Rust |
homepage | |
repository | https://github.com/alkis/decimal |
max_upload_size | |
id | 3613 |
size | 5,480,533 |
Decimal Floating Point arithmetic for rust 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);
$ cargo build
$ ./target/debug/run-test decTest/decQuad.decTest