-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pcall and division by zero #146
Comments
guess extending the numeric operators on how to handle "inf" would be the right move. That is here, right? |
The problem is that Erlang floating point doesn't "inf", if you divide by |
The reason why |
I mean, we would need to extend what the internal representation of a number can be. like adding the Alternatively maybe extend division with a clause to make it op('/', A1, A2, St) ->
numeric_op('/', A1, A2, St, <<"__div">>, fun (_,0) -> lua_error("dividing by 0 bad", St);
(N1,N2) -> N1/N2 end); Not sure if this would work. |
like how close to the official lua c implementation is luerl supposed to be? |
As close as is reasonably possible using standard Erlang and OTP. |
This still crashes in luerl, ignoring the supposed protection of "pcall".
The official lua returns inf, when divided by zero.
Pcall returns true here.
The text was updated successfully, but these errors were encountered: