decimal

Crates.iodecimal
lib.rsdecimal
version2.1.0
sourcesrc
created_at2015-12-11 21:10:00.967956
updated_at2021-03-08 13:43:19.007571
descriptionDecimal floating point arithmetic for Rust
homepage
repositoryhttps://github.com/alkis/decimal
max_upload_size
id3613
size5,480,533
Jonathan Strong (jonathanstrong)

documentation

https://alkis.github.io/decimal

README

decimal

Travis Downloads Crates.io Apache license

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!.

Documentation

Example

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

Running the decTest test suite

$ cargo build
$ ./target/debug/run-test decTest/decQuad.decTest
Commit count: 164

cargo fmt