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

 
fact = 1
e = 2
e0 = 0
n = 2
 
until (e - e0).abs < Float::EPSILON do
  e0 = e
  fact *= n
  n += 1
  e += 1.0 / fact
end
 
puts e
 