Submitter:Fred J. Tydeman
Submission Date:2017-04-24
Document: WG14 N2151

Classes of finite numbers (as in 5.2.4.2.2#3):

• zero
(x = 0, all f[k] are 0)
• sub-normal or de-normal
(x != 0, e = emin , f = 0, all other f[k] digits can be any base-b digit; eg, less than p digits are significant)
• normal
(x != 0, emin <= e, e <= emax, f > 0, all other f[k] digits can be any base-b digit; all possible f[k] digits result in values representable in the type, eg, all p digits are significant)
• super-normal
(x != 0, e > emax , f > 0, f[p] = 0; all other f[k] digits can be any base-b digit; eg, less than p digits are significant)
• extra-normal
(x != 0, emin <= e, e <= emax, f > 0, more than p digits, some of which cannot be any base-b digit; or, some of which can be only certain base-b digits)
• un-normal
(x != 0, emin < e, e <= emax, f = 0, all other f[k] digits can be any base-b digit; eg, less than p digits are significant)

For long double being a pair of doubles:

```high-dbl  low-dbl
0.0       0.0          == zero
0.0       DBL_TRUE_MIN == sub-normal
1.0       0.0          == normal
DBL_MAX   DBL_MAX      == super-normal
1.0       DBL_TRUE_MIN == extra-normal
0.0       1.0          == un-normal

```

================

Things that would need changing if we want double-double added:

• Definition of overflow would need changing:
• super-normal should be considered overflow
• HUGE_VAL is not always the result
• Need more number classification macros:
• FP_SUPERNORMAL,
• FP_EXTRANORMAL
• fpclassify()
• isfinite()
• isnormal()
• frexp()
• References to overflow (strtod, wcstod, nextafter) would need changing.

================

``````
#include <stdio.h>
#include <float.h>
extern long double f(long double);
int main(void){
long double y;
long double x = { ...some values... };

for (int i=0; i < 10; i++ ){
y = f(x[i]);
if( (0.L < y) && (y < LDBL_TRUE_MIN) )
printf("Total loss of precision: underflow");
if( (LDBL_TRUE_MIN <= y) && (y < LDBL_MIN) )
printf("Partial loss of precision: underflow");
if( (LDBL_NORM_MAX < y) && (y <= LDBL_MAX) )
printf("Partial loss of precision: overflow");
if( (LDBL_MAX < y) )
printf("Total loss of precision: overflow");
}/* i */

return 0;
}
```
```

My conclusion is we do not need to change C to better accomodate double-double beyond DRs 432 and 467 and adding LDBL_NORM_MAX.