]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/performance/SumOfInverses.scl
Automatic execution of SCL tests in Maven
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / performance / SumOfInverses.scl
diff --git a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/performance/SumOfInverses.scl b/tests/org.simantics.scl.compiler.tests/src/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