Returns a constant that is "!self" where self is a bool.
(&self)
| 328 | |
| 329 | /// Returns a constant that is "!self" where self is a bool. |
| 330 | pub fn logical_not(&self) -> Self { |
| 331 | match self { |
| 332 | ConstantValue::Int(val) => { |
| 333 | if *val == 1 { |
| 334 | ConstantValue::Int(Integer::from(0)) |
| 335 | } else if *val == 0 { |
| 336 | ConstantValue::Int(Integer::from(1)) |
| 337 | } else { |
| 338 | ConstantValue::Bottom |
| 339 | } |
| 340 | } |
| 341 | ConstantValue::Top => ConstantValue::Top, |
| 342 | _ => ConstantValue::Bottom, |
| 343 | } |
| 344 | } |
| 345 | |
| 346 | /// Returns a constant that is "self % other". |
| 347 | pub fn rem(&self, other: &Self) -> Self { |
no outgoing calls
no test coverage detected