From db4e6659921fc18fc70f742c04fbce668c807316 Mon Sep 17 00:00:00 2001 From: Aslan Askarov Date: Mon, 19 Feb 2024 11:02:34 +0100 Subject: [PATCH] sqrt --- tests/rt/pos/core/sqrt01.golden | 28 ++++++++++++++++++++++++++++ tests/rt/pos/core/sqrt01.trp | 10 ++++++++++ 2 files changed, 38 insertions(+) create mode 100644 tests/rt/pos/core/sqrt01.golden create mode 100644 tests/rt/pos/core/sqrt01.trp diff --git a/tests/rt/pos/core/sqrt01.golden b/tests/rt/pos/core/sqrt01.golden new file mode 100644 index 0000000..04f3fca --- /dev/null +++ b/tests/rt/pos/core/sqrt01.golden @@ -0,0 +1,28 @@ +2024-02-19T10:01:21.535Z [RTM] info: Skipping network creation. Observe that all external IO operations will yield a runtime error. +65536 +256 +16 +4 +2 +1.4142135623730951 +1.189207115002721 +1.0905077326652577 +1.0442737824274138 +1.0218971486541166 +1.0108892860517005 +1.0054299011128027 +1.0027112750502025 +1.0013547198921082 +1.0006771306930664 +1.0003385080526823 +100000000 +10000 +100 +10 +3.1622776601683795 +1.7782794100389228 +1.333521432163324 +1.1547819846894583 +1.0746078283213176 +1.036632928437698 +>>> Main thread finished with value: ()@{}%{} diff --git a/tests/rt/pos/core/sqrt01.trp b/tests/rt/pos/core/sqrt01.trp new file mode 100644 index 0000000..53f69a9 --- /dev/null +++ b/tests/rt/pos/core/sqrt01.trp @@ -0,0 +1,10 @@ +let fun f x n = + if n > 0 then + let val y = sqrt x in + print y; + f y (n -1) + end + else () +in f (65536*65536) 16; + f (10000000000000000) 10 +end \ No newline at end of file