[Cfp-interest 2368] Re: WG14 2022-01 Meeting summary for CFP

Vincent Lefevre vincent at vinc17.net
Wed Feb 9 09:19:37 PST 2022


On 2022-02-09 10:59:06 -0500, Rajan Bhakta wrote:
> 5.8.1 Tydeman, *_HAS_SUBNORM==0 implies what? [N 2797] (the green part
> only, which was skipped at the previous meeting)
>   Fred: Since the standard does not define what happens whether subnormals
> are flushed or not, we added this text to define it.
>   Seacord: Adding positive zero to positive zero is different from +0 to
> -0.
>   Fred: Totally different. Existing hardware has the user being able to
> handle subnormal operands vs results. 4 different modes.
>   Seacord: That has nothing to do with 754? Just hardware?
>   Fred: Operations, not operands in 754. It is optional and CFP is not
> asking C to support it.
>   Joseph: The 754 is different from what HW does. It is complicated and
> depends on the rounding mode.
>   Fred: Doesn't matter for this case. This mainly applies to ARM chips and
> what's in your cell phone.
> 
>   Straw poll: Does WG14 want N2797 (the green text) in C23?
>     15/0/2. Consensus. Goes into C23.

For clarification...

"Whether and in what cases subnormal numbers are treated as zeros is
implementation defined."

Do you mean that in this case, if x is a subnormal number, then
x == 0 may return true and/or x may be printed as 0?

Note that the only requirement about equality seems to be given in
6.2.6.1p4:

  Two values (other than NaNs) with the same object representation
  compare equal, but values that compare equal may have different
  object representations.

And one knows that two different objects may compare equal, e.g.
+0.0 and -0.0 when FP zero is signed (thus they are really different
objects, not the same object with different representations).

But I would have thought that the value of a FP number is the real
value implied by the model.

BTW, if there is a signed infinity, the C standard does not seem to
require that -infinity < x and x < +infinity for any x that represents
a real value. Or what am I missing?

And if there is an unsigned infinity, may one have infinity < x and
x < infinity for any x that represents a real value? (If such a case,
the < relation would not be a strict order relation on the values,
but this does not seem to be required by the standard.)

-- 
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