yali
Yali is a library for representing, and doing arithmetic with, large numbers.
Warnings
- This library only supports positive integers.
- This isn't the most efficient library. This is just one of my small side projects.
Examples
Parse hex value from string:
use Number;
let num_hex = "ab32fa1689fbc2c2631d4343bad3ab2155d";
let num: = num_hex.parse.unwrap;
Regular exponentiation
use Number;
let a = from;
let b = from;
let c = a ^ b;
assert_eq!;
Modular exponentiation
use Number;
let a: = "ab32fa1689fbc2c2631d4343bad3ab2155d".parse.unwrap;
let b: = "10001".parse.unwrap;
let n: = "4343bad3ab2155d89fbc28c2631d".parse.unwrap;
let num = a.mod_exponentiation;