[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Inconsistent rounding of floating point hexadecimal literals
- From: Gé Weijers <ge@...>
- Date: Fri, 4 Dec 2020 09:27:22 -0800
On Fri, Dec 4, 2020 at 9:25 AM Gé Weijers <ge@weijers.org> wrote:
> On a standard compliant C99 compiler you'd have to add:
>
> #include <fenv.h>
> /* ... */
> #pragma STDC FENV_ACCESS ON
> int setround_ok;
> setround_ok = fesetround(round_dir);
> assert(setround_ok == 0);
>
> I know Microsoft compilers have equivalent routines.
>
> --
> Gé
The value of round_dir should be FE_TONEAREST. My cut-and-paste was a
little too hasty.
--
Gé