Explorar o código

exercise 5.12: sum of first 100 terms of Euler sum

George C. Privon hai 1 ano
pai
achega
d1f6a9cd94
Modificáronse 1 ficheiros con 8 adicións e 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