Răsfoiți Sursa

exercise 5.14: convergence of the limit for exp(x)

George C. Privon 1 an în urmă
părinte
comite
9d1d122298
1 a modificat fișierele cu 10 adăugiri și 0 ștergeri
  1. 10 0
      05-Lists/exercises/ex5.14.hs

+ 10 - 0
05-Lists/exercises/ex5.14.hs

@@ -0,0 +1,10 @@
+-- Exercise 5.14
+-- George C. Privon
+-- 2024-07-20
+
+expList :: Double -> [Double]
+expList x = [(1 + x/n)**n | n <- [1..]]
+
+-- This function approximates exp(x)
+-- When x=1, n=49 in order to get 1% accuracy.
+-- When x=10, n=4968 reaches 1% accuracy