lua-users home
lua-l archive

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


On Fri, 7 Feb 2020 at 10:45, Hisham <h@hisham.hm> wrote:
>
> On Fri, 7 Feb 2020 at 12:23, Egor Skriptunoff
> <egor.skriptunoff@gmail.com> wrote:
> >
> > On Fri, Feb 7, 2020 at 1:35 PM Hisham wrote:
> >>
> >> Is this the only difference
> >> you are aware of?
> >>
> >
> > LuaJIT has a quirk with converting out-of-range values
> > from "double" to "int64":
> > For example, bit.bor(2^64, 0LL) is negative
> > Another example (convert -1.0 to uint64):
> > for j = 0, 100 do
> >    local m1 = #{j} * (-1)       -- minus one of type "double"
> >    local zero = bit.bor(m1, 0ULL) + 1 -- must be zero, but...
> >    if j % 100 == 0 then print(zero) end
> > end
>
> Wat -- that is just a plain _bug_, right?

yes, it's a pretty disgusting issue, with lots of _really_ bad
"solutions".  it's unspecified in C, and different processors do
different things on "equivalend" assembly code.

-- 
Javier