1 unstable release

0.1.0 Dec 10, 2021

#1688 in Math

Download history 10/week @ 2025-09-29 11/week @ 2025-10-06 17/week @ 2025-10-13 25/week @ 2025-10-20 4/week @ 2025-10-27 2/week @ 2025-11-03 1/week @ 2025-11-10 1/week @ 2025-12-08 2/week @ 2025-12-15

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

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

Dependencies