Euler

import math import numpy as np e0 = 0 e = 2 n = 0 fact = 1 while(e-e0>np.nextafter(0,1)): e0=e n+=1 fact*=2*n*(2*n+1) e+=(2.*n+2)/fact print(e), print ("Computed e = "+str(e)) print ("Real e = "+str(math.e)) print ("Error = "+str(math.e-e))
 * 1) !/usr/bin/python3