diff --git a/src/runtime.rs b/src/runtime.rs index 0fa00a8..b4f412f 100644 --- a/src/runtime.rs +++ b/src/runtime.rs @@ -1083,11 +1083,11 @@ impl Object { pub fn is_truthy(&self) -> bool { match &self.native { Value::Null => self.kind.lock_ro().id != 0, - Value::Int(x) => x > &0, - Value::Long(x) => x > &0, - Value::Mega(x) => x > &0, - Value::Float(_) => true, - Value::Double(_) => true, + Value::Int(x) => *x > 0, + Value::Long(x) => *x > 0, + Value::Mega(x) => *x > 0, + Value::Float(x) => x.is_finite(), + Value::Double(x) => x.is_finite(), Value::Func(_) => true, Value::Array(_) => true, Value::Str(x) => !x.is_empty(),