Helper function used for multiplying the end-point values of intervals. Caution:** This function contains multiple calls to `unwrap()`, and may return non-standardized interval bounds. Therefore, it should be used with caution. Currently, it is used in contexts where the `DataType` (`dt`) is validated prior to calling this function, and the following interval creation is standardized with `Interv
(
dt: &DataType,
lhs: &ScalarValue,
rhs: &ScalarValue,
)
| 1119 | /// (`dt`) is validated prior to calling this function, and the following |
| 1120 | /// interval creation is standardized with `Interval::new`. |
| 1121 | fn mul_bounds<const UPPER: bool>( |
| 1122 | dt: &DataType, |
| 1123 | lhs: &ScalarValue, |
| 1124 | rhs: &ScalarValue, |
| 1125 | ) -> ScalarValue { |
| 1126 | if lhs.is_null() || rhs.is_null() { |
| 1127 | return ScalarValue::try_from(dt).unwrap(); |
| 1128 | } |
| 1129 | |
| 1130 | match dt { |
| 1131 | DataType::Float64 | DataType::Float32 => { |
| 1132 | alter_fp_rounding_mode::<UPPER, _>(lhs, rhs, |lhs, rhs| lhs.mul_checked(rhs)) |
| 1133 | } |
| 1134 | _ => lhs.mul_checked(rhs), |
| 1135 | } |
| 1136 | .unwrap_or_else(|_| handle_overflow::<UPPER>(dt, Operator::Multiply, lhs, rhs)) |
| 1137 | } |
| 1138 | |
| 1139 | /// Helper function used for dividing the end-point values of intervals. |
| 1140 | /// |
nothing calls this directly
no test coverage detected
searching dependent graphs…