big_num

Crates.iobig_num
lib.rsbig_num
version0.1.0
sourcesrc
created_at2021-12-10 04:40:49.055781
updated_at2021-12-10 04:40:49.055781
descriptionA big number implement in rust
homepage
repositoryhttps://github.com/a1393323447/math_rs/tree/master/big_num
max_upload_size
id495531
size105,571
朕与将军解战袍 (a1393323447)

documentation

README

Big Num

This crate provides:

  • BigInt: Immutable arbitrary-precision integers. All operations behave as if BigInt were represented in two's-complement notation.
  • BigDec: Immutable, arbitrary-precision signed decimal numbers. A BigDecimal consists of an arbitrary precision integer unscaled value and a 32-bit integer scale. (Coming Soon)

Example

use big_num::BigInt;

let a: BigInt = "10000000000000".into();
let b: BigInt = "900000000000".into();
println!("a = {}", a);      
println!("a + b = {}", &a + &b);
println!("a - b = {}", &a - &b);
println!("a * b = {}", &a * &b);
println!("a / b = {}", &a / &b);
println!("a % b = {}", &a % &b);
println!("a << 10 = {}", &a << 10);
println!("a >> 10 = {}", &a >> 10);
Commit count: 0

cargo fmt