1 unstable release

0.1.0 Dec 10, 2021

#1240 in Algorithms

Download history 4/week @ 2024-01-08 15/week @ 2024-02-19 20/week @ 2024-02-26 13/week @ 2024-03-04 16/week @ 2024-03-11 8/week @ 2024-03-18 18/week @ 2024-03-25 38/week @ 2024-04-01

82 downloads per month
Used in tetris-cli

MIT/Apache

105KB
2K SLoC

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);

lib.rs:

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)

Dependencies