[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Strange error with 5.4 random generator on old compiler
- From: bil til <biltil52@...>
- Date: Sat, 3 Dec 2022 07:23:36 +0100
> >> #define LUA_MININTEGER (-0x8000000000000000)
... sorry, but this is really a crazy construction - this you cannot
have from the original LUA code?
I only find in Lua (5.4.4):
#define LUA_MININTEGER LLONG_MIN
#define LLONG_MIN (~0x7fffffffffffffffLL)
0x8000... in any integer system is a sort of "devilish number", as
-0x8000.. is typically identical to +0x8000... (see wiki article about
this / about integers...).
The integer number system has a "nasty" assymmetry, as "good old zero"
is neither positive nor negative (in European middle ages, the zero
was the "number of the devil" (including all negative numbers - they
did not exist in Romanic number writing) - if mathematicians dared to
name this number zero in these times, they could be happy if they did
not land on the fire... :) ) ... the "anti-pole" of zero in binary
integer range is 0x8000... . If you want to do safe programming with
signed numbers, better be do your best to avoid "0x8000..." for the
signed number range... . And specifying this crazy number for a
"..._MIN" define sounds really quite crazy... . (shortly before
"landing on the fire..." :) ).