#代数 #数值

rug-maths

实现maths-traits的rug包装器

7个版本

0.2.5 2021年3月26日
0.2.4 2021年2月5日
0.2.3 2020年5月2日
0.2.2 2020年4月4日
0.1.0 2020年1月18日

数学类别中排名第1278

每月下载量35

AGPL-3.0

40KB
1.5K SLoC

rug-maths

rug结构体的包装器,实现maths-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

依赖关系

~3MB
~50K SLoC