lua-users home
lua-l archive

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

On 21 June 2016 at 14:06, Sergey Zakharchenko <> wrote:
> Off the top of my head, there's something in your environment (gcc and
> clang runtime?) that's configuring the FPU to raise exceptions instead
> of return NaNs (via fesetexceptflag()?). Check with fegetexceptflag().

As my post says, I see this output because I turned on the various
sanitizers when compiling (which are designed to help you find where
your code invokes undefined behaviour).

In C, dividing a double by zero is undefined. From C89 draft standard
> The result of the / operator is the quotient from the division of the first operand by the second; the result of the % operator is the remainder. In both operations, if the value of the second operand is zero, the behavior is undefined.

C99 has much the same to say: