[cfp-interest 3579] nextafterd32() issue

Fred J. Tydeman tydeman at tybor.com
Sun Aug 31 04:22:00 PDT 2025


Consider  nextafterd32( 0.e-5DF, 0.e+3DF )

I see two requirements in C23 about this:

Table 5.2 Preferred quantum exponents
nextafter:  least possible

5.12.11.3 The nextafter functions
The nextafter functions return y if x equals y.

There could be three possible return values:
0.e+3DF         return y (unchanged)
0.e-5DF         return minimum quantum exponent of inputs
0.e-101DF       return least possible quantum exponent of y value


The issue exists for non-zero values:
nextafterd32( 10000.e-2DF, 1.e+2DF )

There could be three possible return values:
1.e+2DF         return y (unchanged)
10000.e-2DF     return minimum quantum exponent of inputs
1000000.e-4DF   return least possible quantum exponent of y value


---
Fred J. Tydeman        Tydeman Consulting
tydeman at tybor.com      Testing, numerics, programming
+1 (702) 608-6093      Vice-chair of INCITS/C (ANSI "C")
Sample C17+FPCE tests: http://www.tybor.com
Savers sleep well, investors eat well, spenders work forever.



More information about the cfp-interest mailing list