Skip to content

Commit

Permalink
Revert "Make the implementation of / and % match FDR2."
Browse files Browse the repository at this point in the history
This reverts commit 32601b8.
  • Loading branch information
tomgr committed Jun 28, 2015
1 parent e61f6a3 commit 234ac03
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/CSPM/Evaluator/Expr.hs
Expand Up @@ -187,9 +187,9 @@ eval (An loc _ (MathsBinaryOp op e1 e2)) = do
Divide -> \ i1 i2 -> do
case i2 of
0 -> throwError $ divideByZeroMessage loc Nothing
_ -> return $ VInt (i1 `quot` i2)
_ -> return $ VInt (i1 `div` i2)
Minus -> \ i1 i2 -> return $ VInt (i1 - i2)
Mod -> \ i1 i2 -> return $ VInt (i1 `rem` i2)
Mod -> \ i1 i2 -> return $ VInt (i1 `mod` i2)
Plus -> \ i1 i2 -> return $ VInt (i1 + i2)
Times -> \ i1 i2 -> return $ VInt (i1 * i2)
return $! do
Expand Down
2 changes: 0 additions & 2 deletions tests/evaluator/should_pass/arithmetic.csp
Expand Up @@ -14,12 +14,10 @@ testDivision5 = 15/8 == 1
testDivision6 = -1/1 == -1
testDivision7 = 100/2 == 50
testDivision8 = 1124/83 == 13
testDivision9 = (-20)/3 == -6

testMod1 = 1%1 == 0
testMod2 = -1%1 == 0
testMod3 = -1%-1 == 0
testMod4 = 4%5 == 4
testMod5 = 5%5 == 0
testMod6 = 0%5 == 0
testMod7 = (-20)%3 == -2

0 comments on commit 234ac03

Please sign in to comment.