Crates.io | big_num |
lib.rs | big_num |
version | 0.1.0 |
source | src |
created_at | 2021-12-10 04:40:49.055781 |
updated_at | 2021-12-10 04:40:49.055781 |
description | A big number implement in rust |
homepage | |
repository | https://github.com/a1393323447/math_rs/tree/master/big_num |
max_upload_size | |
id | 495531 |
size | 105,571 |
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)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);