f172ef3a6b
350: Avoid large intermediate product in LCM r=cuviper a=mhogrefe Changed the implementation of BigUint LCM from `((self * other) / self.gcd(other))` to `self / self.gcd(other) * other` The division is exact in both cases, so the result is the same, but the new code avoids the potentially-large intermediate product, speeding things up and using less memory. I also removed the unnecessary parentheses, because I think it's clear what order everything will be executed in. But if others think differently I can add them back. |
||
---|---|---|
benches | ||
bigint | ||
ci | ||
complex | ||
derive | ||
doc | ||
integer | ||
iter | ||
rational | ||
src | ||
traits | ||
.gitignore | ||
.travis.yml | ||
Cargo.toml | ||
LICENSE-APACHE | ||
LICENSE-MIT | ||
README.md | ||
bors.toml |
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;
Compatibility
Most of the num
crates are tested for rustc 1.8 and greater.
The exception is num-derive
which requires at least rustc 1.15.