Submitter: Fred Tydeman (tydeman@tybor.com)
Author: CFP group
Submission Date: 2022-06-06
Document: WG14 N2993
Title: N2993: Make *_HAS_SUBNORM be obsolescent
Reference Documents: C N2797 (http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2797.htm); C++ (https://wg21.link/p2569r0)
Previous versions: WG14 N2981

Summary: Make the *_HAS_SUBNORM macros in <float.h> be an obsolescent feature.

Discussion

When the red part of paper N2797 was discussed at the November 2021 meeting (section 5.43 of minutes N2921), the committee did not take a vote. Instead, they asked the author to liaise with C++ (this paper is the result of that liaise). In addition, the sense of the committee was removing without first making them obsolescent/deprecated was a bad thing to do. There was some voice to add a runtime query function. There was some voice to further specify these macros.

When the green part of paper N2797 was discussed at the February 2022 meeting (section 5.8.1 in minutes N2941), the committee voted to accept.

The feedback from the SG6 (the C++ numerics sub-group) via the liaison group is:

There are several ways subnormals are "supported" in the field:

Proposal

Add to the end of 5.2.4.2.2, paragraph 14 as indicated and remove the footnote references:

The presence or absence of subnormal numbers is characterized by the implementation-defined values of FLT_HAS_SUBNORM, DBL_HAS_SUBNORM, and LDBL_HAS_SUBNORM:
-1 indeterminable 27)
0 absent (type does not support subnormal numbers)28)
1 present (type does support subnormal numbers)
The use of FLT_HAS_SUBNORM, DBL_HAS_SUBNORM, and LDBL_HAS_SUBNORM macros is an obsolescent feature.

Remove two footnotes attached to that paragraph:

27) Characterization as indeterminable is intended if floating-point operations do not consistently interpret subnormal representations as zero, nor as nonzero.
28) Characterization as absent is intended if no floating-point operations produce subnormal results from non-subnormal inputs, even if the type format includes representations of subnormal numbers.

Add to 7.32.5 Characteristics of floating types <float.h> a new paragraph: The use of FLT_HAS_SUBNORM, DBL_HAS_SUBNORM, and LDBL_HAS_SUBNORM macros is an obsolescent feature.

Straw poll