[Cfp-interest 2445] C++ and subnormals

Fred J. Tydeman tydeman at tybor.com
Wed Jun 22 12:24:09 PDT 2022


This is the latest draft C++ standard I have.

DRAFT INTERNATIONAL STANDARD
ISO/IEC DIS 14882
Voting begins on: 2020-06-11
Programming languages - C++


17.3 Implementation properties [support.limits]
17.3.1 General  [support.limits.general]
1 The headers <limits> (17.3.3), <climits> (17.3.6), and <cfloat>
(17.3.7) supply characteristics of imple-mentation-dependent
arithmetic types (6.8.1).


17.3.4 Floating-point type properties
17.3.4.2 Type float_denorm_style [denorm.style]
namespace std {
 enum float_denorm_style {
  denorm_indeterminate = -1,
  denorm_absent = 0,
  denorm_present = 1
  };
}
1 The presence or absence of subnormal numbers (variable number of
exponent bits) is characterized by the values:
(1.1) - denorm_indeterminate if it cannot be determined whether or not the type allows subnormal values
(1.2) - denorm_absent if the type does not allow subnormal values
(1.3) - denorm_present if the type does allow subnormal values


17.3.5.1 numeric_limits members [numeric.limits.members]
static constexpr float_denorm_style has_denorm;

45 denorm_present if the type allows subnormal values (variable number
   of exponent bits)199 , 
   denorm_absent if the type does not allow subnormal values, 
   and denorm_indeterminate if it is indeterminate
    at compile time whether the type allows subnormal values.
46 Meaningful for all floating-point types.

static constexpr T denorm_min() noexcept;
54 Minimum positive subnormal value.204
55 Meaningful for all floating-point types.
56 In specializations for which has_denorm == false, returns the minimum positive normalized value.

204)Required by LIA-1.



---
Fred J. Tydeman        Tydeman Consulting
tydeman at tybor.com      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.



More information about the Cfp-interest mailing list