| 443 | type Output = Self; |
| 444 | |
| 445 | fn bitor(self, rhs: Self) -> Self::Output { |
| 446 | if self.is_bottom() || rhs.is_bottom() { |
| 447 | Self::bottom() |
| 448 | } else if self.is_top() || rhs.is_top() { |
| 449 | Self::top() |
| 450 | } else if self.all_ones() || rhs.all_ones() { |
| 451 | Self::new(Bound::from(-1i128), Bound::from(-1i128)) |
| 452 | } else if self.is_zero() { |
| 453 | rhs |
| 454 | } else if rhs.is_zero() { |
| 455 | self |
| 456 | } else if let (Ok(lval), Ok(rval)) = (Integer::try_from(self), Integer::try_from(rhs)) { |
| 457 | let or_val = lval | rval; |
| 458 | Self::new(Bound::from(or_val.clone()), Bound::from(or_val)) |
| 459 | } else { |
| 460 | Self::top() |
| 461 | } |
| 462 | } |
| 463 | } |
| 464 | |
| 465 | impl BitXor for Interval { |