about summary refs log tree commit diff
path: root/src/interpret
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2021-10-18 21:58:23 +0200
committerMel <einebeere@gmail.com>2021-10-18 21:58:23 +0200
commitbf0f05e64cc809f74e591c8a88f708265360f07d (patch)
treec721fe127641f37e5858bc2f9e6d1ce52668cce8 /src/interpret
parentefd7e869f23913e73c38cd00644be38c97cd6635 (diff)
downloadrabbithole-bf0f05e64cc809f74e591c8a88f708265360f07d.tar.zst
rabbithole-bf0f05e64cc809f74e591c8a88f708265360f07d.zip
Always make division produce floats.
Diffstat (limited to 'src/interpret')
-rw-r--r--src/interpret/walker.rs2
1 files changed, 1 insertions, 1 deletions
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),
             },
         }
     }