[J3] Question on TINY example

Mark LeAir mleair at nvidia.com
Wed Jun 22 17:40:37 UTC 2022


Another one of our compiler engineers pointed this out to me.  Do we agree this example needs fixing?

In F'2018, 16.9.191, the example has TINY(x) == 2**(-127) for default real.  I think that should be 2**(-126).

32-bit IEEE-754 has an exponent bias of 127.  For example, 1.0 is 0x3f800000, whose exponent field is 127.  So the smallest normal value, which has an exponent field of 1, is 2**(-126) times 1.0.  And TINY() is the smallest normal (full precision) value.

If this example is fixed, then so should the example for RANGE (16.9.158).

If the example for TINY() is not wrong, then the floating-point model used for examples is not IEEE-754, and if that's the case, that should be fixed.

The example for TINY() in draft F'202X is the same (16.9.209).

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20220622/3a98734b/attachment.htm>


More information about the J3 mailing list