From bf0f05e64cc809f74e591c8a88f708265360f07d Mon Sep 17 00:00:00 2001 From: Mel Date: Mon, 18 Oct 2021 21:58:23 +0200 Subject: Always make division produce floats. --- src/interpret/walker.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/interpret/walker.rs b/src/interpret/walker.rs index 1602cd2..e301d44 100644 --- a/src/interpret/walker.rs +++ b/src/interpret/walker.rs @@ -123,7 +123,7 @@ impl Div for WalkValue { }, Self::Int(int) => match rhs { Self::Float(other_float) => Self::Float(int as f64 / other_float), - Self::Int(other_int) => Self::Int(int / other_int), + Self::Int(other_int) => Self::Float(int as f64 / other_int as f64), }, } } -- cgit 1.4.1