pure_decimal

Crates.iopure_decimal
lib.rspure_decimal
version0.0.7
sourcesrc
created_at2018-01-14 12:24:32.593938
updated_at2018-02-07 00:12:17.647732
descriptionA decimal type with no NaN and Infinity
homepage
repositoryhttps://github.com/mmrath/pure_decimal
max_upload_size
id46782
size30,732
publish (github:yaws-rs:publish)

documentation

https://docs.rs/pure_dec

README

Pure Decimal

Travis Downloads Crates.io Apache license

This crate provides a Decimal type which is a wrapper around decimal. This Decimal does not contain infinity and NaN. The objects of this type is can be used as keys in Maps and can be ordered.

Important notice

  • I am sure of the correctness of this library and its usage as keys or sorting. There could be lot of edge case bugs.
  • Performance is not the primary goal of this library. If you need the fastest decimal then this is not the right library

Example

#[macro_use]
extern crate pure_decimal;

fn main() {
    let x = dec!(1.234);
    let y = dec!(1.111);
    let z = dec!(2.345);
    assert_eq(x + y, z);
}
Commit count: 23

cargo fmt