expression

BigUint beyond fixed-width integer limits

BigUint stores nonnegative integers using dynamically sized storage. It supports results larger than u128, but memory and time are finite. Expected stdout (not executed): 340282366920938463463374607431768211456 Common mistake: Assuming arbitrary precision means unlimited computation. Dependency: num-bigint =0.4.6. See the staged Cargo fixture. Exact-version API and resolution not tested.

Formal Syntax & Structure

rust syntaxrust
BigUint::from(n).pow(exp)

Working Example

Example Snippetrust
fn main() {    use num_bigint::BigUint;    let n=BigUint::from(2u32).pow(128);    println!("{}",n);}
Rust Reference