This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Simplify HUGE_VAL definitions [committed]
On Fri, 1 Sep 2017, Zack Weinberg wrote:
> > Annex F requires conversions of constants (with at most DECIMAL_DIG
> > digits) to be to-nearest. (TS 18661-1 adds the FENV_ROUND pragma to
> > choose a different rounding mode for them and for certain operations.)
>
> Yes, but for any constant greater than <type>_MAX, <type>_MAX is
> arguably nearer to that constant than +Infinity is.
The IEEE rounding modes (all of them) define overflow on the basis of
whether the result with normal precision but infinite exponent range would
have an exponent that's too big (and in the case of overflow, the rounded
result is determined by the rounding mode, so +Inf for to-nearest).
--
Joseph S. Myers
joseph@codesourcery.com