lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Jun 5, 2018, at 5:59 AM, Viacheslav Usov <via.usov@gmail.com> wrote:

On Tue, Jun 5, 2018 at 2:33 AM, Albert Chan <albertmcchan@yahoo.com> wrote:

For 53 bits double, to make same math result across platform, 
maybe add this to Lua.c ? (even if not needed)

fesetenv (FE_PC53_ENV);

I suspect the result of that will not be truly cross-platform. Most platforms will fail to compile that [1], but I guess there is one that you happen to use (which one is it?) where that works. To make this truly cross-platform, you should rather say in its stead: #error I cannot set floating-point precision in a cross-platform way [2]

Cheers,
V.



you are right.

fesetround work c99 or higher (I use gcc 4.7.1)

I wanted float math result to be platform independent,
but the patch itself (fesetround) is not platform independent.

Looking at python pyport.h, it is complicated.

Luckily, Python provided binaries to download.