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.nim23
1 files changed, 17 insertions, 6 deletions
diff --git a/tests/stdlib/tfrexp1.nim b/tests/stdlib/tfrexp1.nim
index c6bb2b38c..aa734ddac 100644
--- a/tests/stdlib/tfrexp1.nim
+++ b/tests/stdlib/tfrexp1.nim
@@ -1,13 +1,16 @@
 discard """
-  targets: "js c c++"
-  output: '''ok'''
+  matrix: "--mm:refc; --mm:orc"
+  targets: "js c cpp"
 """
 
-import math
-import strformat
+import std/math
+import std/assertions
 
 const manualTest = false
 
+when manualTest:
+  import strformat
+
 proc frexp_test(lo, hi, step: float64) =
   var exp: int
   var frac: float64
@@ -39,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)
+
+
+doAssert frexp(8.0) == (0.5, 4)
+doAssert frexp(-8.0) == (-0.5, 4)
+doAssert frexp(0.0) == (0.0, 0)
 
-echo "ok"
+block:
+  var x: int
+  doAssert frexp(5.0, x) == 0.625
+  doAssert x == 3