C++ Logo


Advanced search

[wg14/wg21 liaison] *_HAS_SUBNORM

From: Fred J. Tydeman <tydeman_at_[hidden]>
Date: Thu, 02 Dec 2021 08:18:03 -0800 (PST)
Issue for C++ liason group.

The WG14 paper:
discusses several issues with the *_HAS_SUBNORM macros.

Issue 1: What to do with *_HAS_SUBNORM?
  Remove now from C23 (and maybe C++) -- WG14 voted against this
  Make them obsolescent in C23
  Leave as is
  Expand (along the lines of the above paper)

Issue 2:
Since some people claim that nothing is said in C17 about flushing
subnormals to zero, doing that is Undefined Behavior (UB).

We suggest adding to (to make clear it is not UB):

Whether and in what cases subnormal numbers are treated as zeros is
implementation defined. Subnormal numbers that in some cases are
treated by arithmetic operations as zeros are properly classified as
subnormal. However, object representations that could represent
subnormal numbers but that are always treated by arithmetic operations
as zeros are noncanonical zeros, and the values are properly
classified as zero, not subnormal. IEC 60559 arithmetic (with default
exception handling) always treats subnormal numbers as nonzero.

Adding that is independent of issue 1.

Fred J. Tydeman        Tydeman Consulting
tydeman_at_[hidden]      Testing, numerics, programming
+1 (702) 608-6093      Vice-chair of PL22.11 (ANSI "C")
Sample C99+FPCE tests: http://www.tybor.com
Savers sleep well, investors eat well, spenders work forever.

Received on 2021-12-02 10:18:07