Task

Calculate the value of   e.



(e   is also known as   Euler's number   and   Napier's constant.)



See details: Calculating the value of e

# If you need high precision: Sum of a Taylor series method.
# Adjust the terms parameter to suit. Theoretically the
# terms could be ∞. Practically, calculating an infinite
# series takes an awfully long time so limit to 500.
 
sub postfix:<!> (Int $n) { (constant f = 1, |[\*] 1..*)[$n] }
sub 𝑒 (Int $terms) { sum map { FatRat.new(1,.!) }, ^$terms }
 
say 𝑒(500).comb(80).join: "\n";
 
say '';
 
# Or, if you don't need high precision, it's a built-in.
say e;