C++ Logo

std-proposals

Advanced search

Re: [std-proposals] ISO/IEC 60559 Classification for std::numeric_limits

From: Jan Schultke <janschultke_at_[hidden]>
Date: Sun, 19 Apr 2026 06:38:00 +0200
> And is it only about the format or also about the behavior of the types
> under common mathematical operations?
>

The amount of feedback you can provide for "format behavior" is pretty
limited because we don't have any types that require ISO/IEC 60559
behavior. is_iec559 only imposes requirements on the representable, not on
whether e.g. certain calculations are correctly rounded or infinities and
NaNs are propagated and produced by operations. Similarly, C's _Float32 and
other interchange floating types don't imply Annex F conformance, and the C
wording is very clear about that.

So for traits, I would focus on representation properties rather than
operations.

 And format (as I think was mentioned) can be storage format or range of
> mantissa and exponent.
>

There is flexibility, but you can still classify a format as generally
being an ISO/IEC 60559 binary interchange format, which at least tells you
that infinities and NaNs are present and that the format represents values
in the same way, even though with different amount of exponent or mantissa
bits. I think both having a quick and reliable way to classify a format as
binary32 and having a way to query information about floating-point
representations in general are necessary.

Received on 2026-04-19 04:38:13