22722ac55d
We can save a multiplication if we start the accumulation basically at the first set bit of the exponent, rather than starting at one and waiting to multiply. We only need one itself if the exponent is zero, which is easy to pre-check. Before: test pow_bench ... bench: 8,267,370 ns/iter (+/- 93,319) After: test pow_bench ... bench: 7,506,463 ns/iter (+/- 116,311) |
||
---|---|---|
.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;