rug-maths

Crates.iorug-maths
lib.rsrug-maths
version0.2.5
sourcesrc
created_at2020-01-18 20:55:31.518942
updated_at2021-03-26 18:14:46.635252
descriptionrug wrapper implementing maths-traits
homepagehttps://framagit.org/ZettaScript/rug-maths
repositoryhttps://framagit.org/ZettaScript/rug-maths
max_upload_size
id199847
size74,153
ZettaScript (ZettaScript)

documentation

https://docs.rs/rug-maths

README

rug-maths

A wrapper for the rug structs, implementing maths-traits traits. It enables computing with arbitrary precision, with algebra & analysis traits.

Example

let z = Complex::with_val(53, (123, 369)); // 123 + 369i
let a = z.real(); // 123
let b = z.imag(); // 369

let n = Integer::from(101);
assert!(n.prime()); // Check primality
assert!(!(n+1).prime());

let a = Integer::from(27);
let b = Integer::from(72);
assert_eq!(a.clone().gcd(b.clone()), Integer::from(9)); // Compute GCD
assert_eq!(a.lcm(b), Integer::from(216)); // Compute LCM
Commit count: 0

cargo fmt