summary refs log tree commit diff stats
path: root/tests/stdlib/tfrexp1.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/stdlib/tfrexp1.nim')
-rw-r--r--tests/stdlib/tfrexp1.nim19
1 files changed, 14 insertions, 5 deletions
diff --git a/tests/stdlib/tfrexp1.nim b/tests/stdlib/tfrexp1.nim
index a32ecbc23..aa734ddac 100644
--- a/tests/stdlib/tfrexp1.nim
+++ b/tests/stdlib/tfrexp1.nim
@@ -1,9 +1,10 @@
 discard """
-  targets: "js c c++"
-  output: '''ok'''
+  matrix: "--mm:refc; --mm:orc"
+  targets: "js c cpp"
 """
 
-import math
+import std/math
+import std/assertions
 
 const manualTest = false
 
@@ -41,6 +42,14 @@ when manualTest:
 
   frexp_test(-1000.0, 1000.0, 0.0125)
 else:
-  frexp_test(-1000000.0, 1000000.0, 0.125)
+  frexp_test(-200000.0, 200000.0, 0.125)
 
-echo "ok"
+
+doAssert frexp(8.0) == (0.5, 4)
+doAssert frexp(-8.0) == (-0.5, 4)
+doAssert frexp(0.0) == (0.0, 0)
+
+block:
+  var x: int
+  doAssert frexp(5.0, x) == 0.625
+  doAssert x == 3