Applies the given binary operator the `lhs` and `rhs` arguments.
(op: &Operator, lhs: &Interval, rhs: &Interval)
| 1044 | |
| 1045 | /// Applies the given binary operator the `lhs` and `rhs` arguments. |
| 1046 | pub fn apply_operator(op: &Operator, lhs: &Interval, rhs: &Interval) -> Result<Interval> { |
| 1047 | match *op { |
| 1048 | Operator::Eq => lhs.equal(rhs), |
| 1049 | Operator::NotEq => lhs.equal(rhs)?.not(), |
| 1050 | Operator::Gt => lhs.gt(rhs), |
| 1051 | Operator::GtEq => lhs.gt_eq(rhs), |
| 1052 | Operator::Lt => lhs.lt(rhs), |
| 1053 | Operator::LtEq => lhs.lt_eq(rhs), |
| 1054 | Operator::And => lhs.and(rhs), |
| 1055 | Operator::Or => lhs.or(rhs), |
| 1056 | Operator::Plus => lhs.add(rhs), |
| 1057 | Operator::Minus => lhs.sub(rhs), |
| 1058 | Operator::Multiply => lhs.mul(rhs), |
| 1059 | Operator::Divide => lhs.div(rhs), |
| 1060 | _ => internal_err!("Interval arithmetic does not support the operator {op}"), |
| 1061 | } |
| 1062 | } |
| 1063 | |
| 1064 | /// Helper function used for adding the end-point values of intervals. |
| 1065 | /// |
no test coverage detected
searching dependent graphs…