Hyperoperation
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.
Features
- Calculate value of hyperoperations (docs)
- Format hyperoperations with Knuth's up-arrow notation (docs)
- Use any unsigned numeric type for calculation fitting some conditions, such as BigUint
Examples
Simple calculation:
use *;
assert_eq!;
Using BigUint to handle big results without overflowing (don't forget to add num_bigint as your dependency) :
use *;
use BigUint;
let result = ; // 5 ↑↑ 3
println!;
assert_eq!;
Using Hyperoperation structand formatting it with Knuth's up-arrow notation:
use *;
let expr = new; // Represents 3 ↑↑ 3
let result = expr.clone.evaluate; // Calculate the value of 3 ↑↑ 3
println!;
assert_eq!;
assert_eq!;