(&self, other: &Box<dyn Value>)
| 72 | } |
| 73 | |
| 74 | fn div_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> { |
| 75 | if let Some(other_int) = other.as_any().downcast_ref::<FloatValue>() { |
| 76 | let value = self.value / other_int.value; |
| 77 | return Ok(Box::new(FloatValue { value })); |
| 78 | } |
| 79 | Err("Unexpected value to perform `/` with".to_string()) |
| 80 | } |
| 81 | |
| 82 | fn neg_op(&self) -> Result<Box<dyn Value>, String> { |
| 83 | Ok(Box::new(FloatValue { value: -self.value })) |
no test coverage detected