Skip to content

Commit

Permalink
Fixed modulo once again
Browse files Browse the repository at this point in the history
  • Loading branch information
MCJack123 authored Apr 3, 2021
1 parent e076ae7 commit 2cdee55
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k) {

static lua_Number luai_nummod(lua_Number a, lua_Number b) {
lua_Number q = fmod(a, b);
if ((a < 0) != (b < 0)) return q + b;
if ((a < 0) != (b < 0) && q != 0) return q + b;
return q;
}

Expand Down

0 comments on commit 2cdee55

Please sign in to comment.