Skip to content
forked from alkis/decimal

Decimal Floating Point arithmetic for rust

License

Notifications You must be signed in to change notification settings

nacaclanga/decimal

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Decimal Floating Point arithmetic for rust

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 93.7%
  • Rust 6.1%
  • HTML 0.2%