a480c7ca6c
The default implementations of to_f32, to_f64, from_32 and from_f64 are limited to numbers fitting in i64 but BigInt can of course be much bigger. The default to_f32 also has double rounding. from_f32 and from_f64 have undefined behaviour if the float is too big to fit in an i64. This fixes these issues and keeps the rounding consistant with other float to int conversions. Also add ToBigUint and ToBigInt implementations for f32 and f64. |
||
---|---|---|
.travis | ||
benches | ||
doc | ||
num-macros | ||
src | ||
.gitignore | ||
.multirust.sh | ||
.travis.yml | ||
Cargo.toml | ||
LICENSE-APACHE | ||
LICENSE-MIT | ||
README.md |
README.md
num
A collection of numeric types and traits for Rust.
This includes new types for big integers, rationals, and complex numbers, new traits for generic programming on numeric properties like `Integer, and generic range iterators.
Usage
Add this to your Cargo.toml
:
[dependencies]
num = "0.1"
and this to your crate root:
extern crate num;