test fp downconvert on min and normal numbers, +/- a bit
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 11 Feb 2020 22:10:43 +0000 (22:10 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 11 Feb 2020 22:10:43 +0000 (22:10 +0000)
src/ieee754/fcvt/test/rangelimited.py

index eacb35341d5f267e4648a64a8c1e4c284dd9cfd1..9a40e9ebae1c1439f41b68197f43752c399e22d3 100644 (file)
@@ -28,9 +28,21 @@ def create_ranged_target(fkls, target):
 def create_ranged_fp16(fkls):
     return create_ranged_target(fkls, 65519.0)
 
+def create_ranged_min_fp16(fkls):
+    return create_ranged_target(fkls, pow(2, -24))
+
+def create_ranged_min_normal_fp16(fkls):
+    return create_ranged_target(fkls, pow(2, -14))
+
 def create_ranged_fp32(fkls):
     return create_ranged_target(fkls, 3.402823466E38)
 
+def create_ranged_min_fp32(fkls):
+    return create_ranged_target(fkls, pow(2, -149))
+
+def create_ranged_min_normal_fp32(fkls):
+    return create_ranged_target(fkls, pow(2, -126))
+
 def create_ranged_float(fkls, mainwid, fracwid):
     """create a floating-point number