浏览代码

exercise 5.12: sum of first 100 terms of Euler sum

George C. Privon 1 年之前
父节点
当前提交
d1f6a9cd94
共有 1 个文件被更改,包括 8 次插入0 次删除
  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