[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Setting Float Precision in Lua.c
- From: Albert Chan <albertmcchan@...>
- Date: Sun, 10 Jun 2018 21:20:43 -0400
>> --> Lua get hit with 3 double roundings, set z = 1e16 + 12
>
> It's been a long thread. What exactly do you suggest that should be
> added to Lua? Explicit code welcome.
>> Bad rounding is compensated by higher internal float precision.
> Turns out, above statement is *wrong* ... Sorry
I was just trying to correct above statement.
To keep code under c99, perhaps like this ?
#include <fenv.h>
#ifdef FE_PC53_ENV
fesetenv(FE_PC53_ENV);
#elif LUA_SET_53BITS /* user defined way */
LUA_SET_53BITS;
#else /* do nothing */
#warning Lua is compiled with default rounding precision
#endif