]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/tests/org/simantics/scl/compiler/tests/performance/SumOfInverses.scl
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.scl.compiler / tests / org / simantics / scl / compiler / tests / performance / SumOfInverses.scl
diff --git a/bundles/org.simantics.scl.compiler/tests/org/simantics/scl/compiler/tests/performance/SumOfInverses.scl b/bundles/org.simantics.scl.compiler/tests/org/simantics/scl/compiler/tests/performance/SumOfInverses.scl
new file mode 100644 (file)
index 0000000..a3f9407
--- /dev/null
@@ -0,0 +1,8 @@
+import "Prelude"\r
+\r
+main :: Double -> Double\r
+main m = loop 1 0\r
+  where\r
+    loop x cur = if x > m\r
+                 then cur\r
+                 else loop (x+1) (cur + 1 / x)
\ No newline at end of file