Trait and Functions for efficient development and Computing large numbers

Crates.io Rust license

Examples

rust use libnum::Numeric; fn main() { // Computing large number of addition, subtraction, multiplication, and division let a = "1515454551515151411651651515151665959595956262626265655555599999999999555555555552222222222666666666666663333".to_string(); let b = "9898989898989898989898989898978787979979797979797979797979797979".to_string(); println!("{}", a.add(b.clone()).unwrap()); ## div rust let c = "15454545151513193895151.4215".to_string(); let d = "1545151514151515.313".to_string(); println!("{}", c.div(d.clone()).unwrap()); ## mul rust let c = "15454545151513193895151.4215".to_string(); let d = "1545151514151515.313".to_string(); println!("{}", c.mul(d.clone()).unwrap()); ## sub rust let c = "15454545151513193895151.4215".to_string(); let d = "1545151514151515.313".to_string(); println!("{}", c.sub(d.clone()).unwrap()); ## add rust let c = "15454545151513193895151.4215".to_string(); let d = "1545151514151515.313".to_string(); println!("{}", c.add(d.clone()).unwrap()); ## xor operation rust let c = "15454545151513193895151".to_string(); let d = "15".to_string(); println!("{}", c.xor_operation(d.clone()).unwrap()); ## or operation rust let c = "15454545151513193895151".to_string(); let d = "15".to_string(); println!("{}", c.or_operation(d.clone()).unwrap()); ## and operation rust let c = "15454545151513193895151".to_string(); let d = "15".to_string(); println!("{}", c.and_operation(d.clone()).unwrap()); ## left shift operation rust let c = "15454545151513193895151".to_string(); let d = 15; println!("{}", c.right_shift(d).unwrap()); ## left shift operation rust let c = "15454545151513193895151".to_string(); let d = 15; println!("{}", c.left_shift(d).unwrap()); ## and operation rust let c = "15454545151513193895151.4215".to_string(); let d = "15.313".to_string(); println!("{}", c.mod_operation(d.clone()).unwrap()); ## log rust let c = "15454545151513193895151.4215".to_string(); let d = "15.313".to_string(); println!("{}", c.log(d.clone()).unwrap()); ## atan rust let c = "15454545151513193895151.4215".to_string(); println!("{}", c.atan().unwrap()); ## acos rust let c = "15454545151513193895151.4215".to_string(); println!("{}", c.acos().unwrap()); ## asin rust let c = "15454545151513193895151.4215".to_string(); println!("{}", c.asin().unwrap()); ## tan rust let c = "15454545151513193895151.4215".to_string(); println!("{}", c.tan().unwrap()); ## cos rust let c = "15454545151513193895151.4215".to_string(); println!("{}", c.cos().unwrap()); ## sin rust let c = "15454545151513193895151.4215".to_string(); println!("{}", c.sin().unwrap()); ## log10 rust let c = "15454545151513193895151.4215".to_string(); println!("{}", c.log10().unwrap()); ## log2 rust let c = "15454545151513193895151.4215".to_string(); println!("{}", c.log2().unwrap()); ## exp rust let c = "15454545151513193895151.4215".to_string(); println!("{}", c.exp().unwrap()); ## sqrt rust let c = "15454545151513193895151.4215".to_string(); println!("{}", c.sqrt().unwrap()); ## pow rust let c = "15454545151513193895151.4215".to_string(); let d = "1545151514151515.313".to_string(); println!("{}", c.pow(d.clone()).unwrap());