Skip to content

Commit

Permalink
issue #127 IDIV applied on doubles does not yield integer values
Browse files Browse the repository at this point in the history
  • Loading branch information
Dibyendu Majumdar committed Jul 1, 2017
1 parent 4be1109 commit 20e29c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1318,8 +1318,8 @@ static void codebinexpval (FuncState *fs, OpCode op,
&& e1->ravi_type == RAVI_TNUMINT && e2->ravi_type == RAVI_TNUMINT)
e1->ravi_type = RAVI_TNUMFLT;
else if ((op == OP_IDIV)
&& (e1->ravi_type == RAVI_TNUMINT || e1->ravi_type == RAVI_TNUMFLT)
&& (e2->ravi_type == RAVI_TNUMINT || e2->ravi_type == RAVI_TNUMFLT))
&& (e1->ravi_type == RAVI_TNUMINT)
&& (e2->ravi_type == RAVI_TNUMINT))
e1->ravi_type = RAVI_TNUMINT;
else if ((op == OP_BAND || op == OP_BOR || op == OP_BXOR || op == OP_SHL || op == OP_SHR)
&& e1->ravi_type == RAVI_TNUMINT && e2->ravi_type == RAVI_TNUMINT)
Expand Down

0 comments on commit 20e29c6

Please sign in to comment.