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

Vincent Lefevre vincent at vinc17.net
Mon Feb 14 18:34:43 PST 2022


On 2022-02-13 10:11:27 -0800, Jim Thomas wrote:
> On Feb 9, 2022, at 9:19 AM, Vincent Lefevre <vincent at vinc17.net> wrote:
> > "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?
> 
> Yes.

Something else that is not clear is whether this is still allowed
when Annex F is claimed to be supported, i.e. whether this overrides
the bindings specified in Annex F.

> > 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.
> 
> Right. But the model representation is an abstraction that doesn’t
> necessarily match the bit pattern. A C object representation
> containing the bit pattern of a 754 subnormal need not represent a
> subnormal number in the C model. A C implementation (not supporting
> Annex F) may regard all 754 subnormals as zeros.

The bit pattern is off-topic in 5.2.4.2.2 (this would be a bit like
if, in IEEE 754, you were talking about Level 4 in a context about
Level 2 only). And if Annex F is not supported, then "754 subnormals"
is meaningless.

> > 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?
> 
> C 6.5.8 says "Each of the operators < (less than), > (greater than),
> <= (less than or equal to), and >= (greater than or equal to) shall
> yield 1 if the specified relation is true and 0 if it is false. This
> applies to signed infinities as well as to any other numbers.

These relations are mathematically defined over the real numbers.
But infinities are an addition of the C standard (assuming Annex F
is not supported).

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