From: Luke Kenneth Casson Leighton Date: Tue, 11 Feb 2020 22:10:43 +0000 (+0000) Subject: test fp downconvert on min and normal numbers, +/- a bit X-Git-Tag: ls180-24jan2020~196 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e466d04a2ec9f27e96ac5723e8f26b962dec5d23;p=ieee754fpu.git test fp downconvert on min and normal numbers, +/- a bit --- diff --git a/src/ieee754/fcvt/test/rangelimited.py b/src/ieee754/fcvt/test/rangelimited.py index eacb3534..9a40e9eb 100644 --- a/src/ieee754/fcvt/test/rangelimited.py +++ b/src/ieee754/fcvt/test/rangelimited.py @@ -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