This crate allows to calculate and format hyperoperation, sometimes known as Knuth's up-arrow notation, which is a way to define very large numbers, such as famous 3↑↑↑3.
Simple calculation:
rust
use hyperoperation::*;
assert_eq!(
hyperoperation::<u64>(&3, 3, 2), // 3 ↑↑ 3
7625597484987
);
Using BigUint to handle big results without overflowing (don't forget to add num_bigint
as your dependency) :
```rust use hyperoperation::*; use num_bigint::BigUint;
let result = hyperoperation::
Using Hyperoperation structand formatting it with Knuth's up-arrow notation:
```rust
use hyperoperation::*;
let expr = Hyperoperation::
println!("{expr} = {result}"); asserteq!(result, 7625597484987); asserteq!(format!("{expr}"), "3 ↑↑ 3"); ```