(&self, other: &Box<dyn Value>)
| 56 | } |
| 57 | |
| 58 | fn sub_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> { |
| 59 | if let Some(other_int) = other.as_any().downcast_ref::<FloatValue>() { |
| 60 | let value = self.value - other_int.value; |
| 61 | return Ok(Box::new(FloatValue { value })); |
| 62 | } |
| 63 | Err("Unexpected value to perform `-` with".to_string()) |
| 64 | } |
| 65 | |
| 66 | fn mul_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> { |
| 67 | if let Some(other_int) = other.as_any().downcast_ref::<FloatValue>() { |