From d1e8539edd57c0e7cef4d9ba7ba20d099f74020b Mon Sep 17 00:00:00 2001 From: AvicennaJr Date: Wed, 11 Oct 2023 13:59:46 +0300 Subject: [PATCH] fix: modulus operation between float and int --- evaluator/infix.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/evaluator/infix.go b/evaluator/infix.go index c20706a..33fa484 100644 --- a/evaluator/infix.go +++ b/evaluator/infix.go @@ -117,6 +117,8 @@ func evalFloatIntegerInfixExpression(operator string, left, right object.Object, val = math.Pow(float64(leftVal), float64(rightVal)) case "/": val = leftVal / rightVal + case "%": + val = math.Mod(leftVal, rightVal) case "<": return nativeBoolToBooleanObject(leftVal < rightVal) case "<=":