Commit Graph

6 Commits

Author SHA1 Message Date
Stephen Heumann facd1bf992 Add parentheses around negative values in float.h. 2022-12-04 22:44:48 -06:00
Stephen Heumann cad042b95b Add new <float.h> macros from C99 and C11. 2021-03-08 19:16:28 -06:00
Stephen Heumann 0ba8e4adb0 Update the limit values in <float.h>.
The correct values for LDBL_MAX and LDBL_MIN can now be provided, because we support long double constants. The other values are also updated to have more precision, so that they evaluate to bit-correct values in the long double format.
2021-03-08 18:32:33 -06:00
Stephen Heumann 92048171ef Update definition of FLT_ROUNDS to reflect the dynamic rounding mode. 2021-03-06 16:40:35 -06:00
Stephen Heumann dc0f7dc4e4 Correct most of the LDBL_* values in <float.h>.
These had been the values appropriate for double, not accounting for the fact that long double is now the 80-bit extended type.

The integer LDBL_* values have now all been updated to be correct, as has LDBL_EPSILON. LDBL_MAX and LDBL_MIN are still not correct, because ORCA/C internally processes floating-point constants in the double format, and so the correct values would get rounded to INF and 0, respectively.

Note that the SANE 80-bit extended format is almost like the x87 80-bit extended format used for long double on many modern systems, but not entirely. The difference is that SANE allows the biased exponent field of an extended value (either normalized or denormalized) to be 0, yielding an effective exponent of 0-16383 = -16383. x87 uses an effective exponent of -16382 in these cases (which it considers to be pseudo-denormalized or denormalized), yielding values that are twice as large as the SANE values. This difference causes LDBL_MIN_EXP to be different, and would also cause LDBL_MIN to be different if it could be represented correctly.
2018-09-08 22:39:30 -05:00
Stephen Heumann 3225a54d76 Move ORCACDefs directory to root level. 2017-10-21 20:21:37 -05:00