https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61399
Vincent Lefèvre <vincent-gcc at vinc17 dot net> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |UNCONFIRMED Resolution|INVALID |--- --- Comment #5 from Vincent Lefèvre <vincent-gcc at vinc17 dot net> --- I'm reopening this PR since it is actually not solved. There are two remaining issues. The first issue is no longer the formula, but the fact that LDBL_MAX is strictly less than the maximum normalized number in the floating-point model. I think that either LDBL_MAX_EXP should be reduced to 1023 (thus any representable value with exponent 1024 would be regarded as unnormalized), or the standard should be corrected in some other way, e.g. to allow an incomplete binade for the largest exponent. The second issue is that one can get a finite value 0x1.fffffffffffff7ffffffffffffcp+1023 that is strictly larger than LDBL_MAX = 0x1.fffffffffffff7ffffffffffff8p+1023 (see the first and third numbers output by my program given in comment 0). Thus LDBL_MAX is not the maximum representable finite number as required by the standard.