[Cfp-interest 2077] Underflow and overflow

Vincent Lefevre vincent at vinc17.net
Wed Jul 28 03:15:21 PDT 2021


On 2021-07-28 11:40:56 +0200, Vincent Lefevre wrote:
> This may be OK with IEEE 754 types, but not with the general FP model
> of ISO C, where you may have numbers less than the minimum normalized
> number in magnitude, but are not subnormals, nor zero. So, I think
> that "subnormal" should be avoided. Another issue is how you can
> decide that the result is an inexact zero, assuming that correct
> rounding is not required.

BTW, N2746 has a similar issue with overflow. It proposes:

  A floating result overflows if a finite result value with
  ordinary accuracy would have magnitude (absolute value) too
  large for representation in an object of the specified type.

It should be:

  A floating result overflows if a finite result value with
  ordinary accuracy would have magnitude (absolute value)
  larger than the maximum normalized number.

(By maximum normalized number, this is FLT_NORM_MAX, etc., as
opposed to FLT_MAX, etc.)

Comparing with the maximum normalized number would be similar
to underflow (with the minimum normalized number). Above the
maximum normalized number, an error analysis may no longer be
valid, so that it is the right bound to take into account.

-- 
Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


More information about the Cfp-interest mailing list