lua-users home
lua-l archive

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


> Builds and runs on NetBSD 6.1.5 on sparc64, but gets an assertation
> failure running the test suite:
> 
> ***** FILE 'math.lua'*****
> testing numbers and math lib
> 64-bit integers, 53-bit (mantissa) floats
> /usr/local/bin/lua: math.lua:155: assertion failed!
> stack traceback:
>         [C]: in function 'assert'
>         math.lua:155: in main chunk
>         (...tail calls...)
>         all.lua:177: in main chunk
>         [C]: in ?
> .>>> closing state <<<

The line in question is this:

        assert(eq(i^j, 1 / i^(-j)))

This error is probably due to a poor implementation of 'pow'. (That
is why we do not distribute the test suite with Lua; it is too much
sensitive to the libc.)

You might change that line to
        print(i, j, i^j, 1 / i^(-j)); assert(eq(i^j, 1 / i^(-j)))
to see what is going on.

-- Roberto