Crates.io | rug-maths |
lib.rs | rug-maths |
version | 0.2.5 |
source | src |
created_at | 2020-01-18 20:55:31.518942 |
updated_at | 2021-03-26 18:14:46.635252 |
description | rug wrapper implementing maths-traits |
homepage | https://framagit.org/ZettaScript/rug-maths |
repository | https://framagit.org/ZettaScript/rug-maths |
max_upload_size | |
id | 199847 |
size | 74,153 |
A wrapper for the rug structs, implementing maths-traits traits. It enables computing with arbitrary precision, with algebra & analysis traits.
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