Explorar el Código

exercise 5.12: sum of first 100 terms of Euler sum

George C. Privon hace 1 año
padre
commit
d1f6a9cd94
Se han modificado 1 ficheros con 8 adiciones y 0 borrados
  1. 8 0
      05-Lists/exercises/ex5.12.hs

+ 8 - 0
05-Lists/exercises/ex5.12.hs

@@ -0,0 +1,8 @@
+-- Exercise 5.12
+-- George C. Privon
+-- 2024-07-20
+
+sumrecipn :: Double
+sumrecipn = sum [1/x**2 | x <- [1..100]]
+
+-- The sum of the first 100 terms is 1.6349839001848923