libnum

Crates.iolibnum
lib.rslibnum
version0.1.2
sourcesrc
created_at2023-05-29 16:05:12.8956
updated_at2023-06-26 07:55:14.810729
descriptionFunctions for efficient development in Math and Crypto
homepagehttps://dnrops.gitee.io
repositoryhttps://gitlab.com/andrew_ryan/libnum
max_upload_size
id877211
size37,517
zinso (zinso)

documentation

https://docs.rs/libnum

README

Trait and Functions for efficient development and Computing large numbers

Crates.io Rust license

Examples

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

   let c = "15454545151513193895151.4215".to_string();
   let d = "1545151514151515.313".to_string();
   println!("{}", c.div(d.clone()).unwrap());

mul

   let c = "15454545151513193895151.4215".to_string();
   let d = "1545151514151515.313".to_string();
   println!("{}", c.mul(d.clone()).unwrap());

sub

   let c = "15454545151513193895151.4215".to_string();
   let d = "1545151514151515.313".to_string();
   println!("{}", c.sub(d.clone()).unwrap());

add

   let c = "15454545151513193895151.4215".to_string();
   let d = "1545151514151515.313".to_string();
   println!("{}", c.add(d.clone()).unwrap());

xor operation

   let c = "15454545151513193895151".to_string();
   let d = "15".to_string();
   println!("{}", c.xor_operation(d.clone()).unwrap());

or operation

   let c = "15454545151513193895151".to_string();
   let d = "15".to_string();
   println!("{}", c.or_operation(d.clone()).unwrap());

and operation

   let c = "15454545151513193895151".to_string();
   let d = "15".to_string();
   println!("{}", c.and_operation(d.clone()).unwrap());

left shift operation

   let c = "15454545151513193895151".to_string();
   let d = 15;
   println!("{}", c.right_shift(d).unwrap());

left shift operation

   let c = "15454545151513193895151".to_string();
   let d = 15;
   println!("{}", c.left_shift(d).unwrap());

and operation

   let c = "15454545151513193895151.4215".to_string();
   let d = "15.313".to_string();
   println!("{}", c.mod_operation(d.clone()).unwrap());

log

   let c = "15454545151513193895151.4215".to_string();
   let d = "15.313".to_string();
   println!("{}", c.log(d.clone()).unwrap());

atan

   let c = "15454545151513193895151.4215".to_string();
   println!("{}", c.atan().unwrap());

acos

   let c = "15454545151513193895151.4215".to_string();
   println!("{}", c.acos().unwrap());

asin

   let c = "15454545151513193895151.4215".to_string();
   println!("{}", c.asin().unwrap());

tan

   let c = "15454545151513193895151.4215".to_string();
   println!("{}", c.tan().unwrap());

cos

   let c = "15454545151513193895151.4215".to_string();
   println!("{}", c.cos().unwrap());

sin

   let c = "15454545151513193895151.4215".to_string();
   println!("{}", c.sin().unwrap());

log10

   let c = "15454545151513193895151.4215".to_string();
   println!("{}", c.log10().unwrap());

log2

   let c = "15454545151513193895151.4215".to_string();
   println!("{}", c.log2().unwrap());

exp

   let c = "15454545151513193895151.4215".to_string();
   println!("{}", c.exp().unwrap());

sqrt

   let c = "15454545151513193895151.4215".to_string();
   println!("{}", c.sqrt().unwrap());

pow

   let c = "15454545151513193895151.4215".to_string();
   let d = "1545151514151515.313".to_string();
   println!("{}", c.pow(d.clone()).unwrap());
Commit count: 0

cargo fmt