Ver código fonte

exercise 5.12: sum of first 100 terms of Euler sum

George C. Privon 1 ano atrás
pai
commit
d1f6a9cd94
1 arquivos alterados com 8 adições e 0 exclusões
  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