near-decimal

Crates.ionear-decimal
lib.rsnear-decimal
version2.2.0
sourcesrc
created_at2022-01-06 15:31:22.139803
updated_at2022-01-07 12:19:24.648738
descriptionDecimal floating point arithmetic for Rust
homepage
repositoryhttps://github.com/dmstjd0182/near-decimal
max_upload_size
id509017
size5,461,658
BlockES (dmstjd0182)

documentation

https://alkis.github.io/decimal

README

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);
Commit count: 0

cargo fmt