Calculates the multiplication of two (possibly inexact) [`usize`] values, conservatively propagating exactness information. If one of the input values is [`Precision::Absent`], the result is `Absent` too.
(&self, other: &Precision<usize>)
| 178 | /// conservatively propagating exactness information. If one of the input |
| 179 | /// values is [`Precision::Absent`], the result is `Absent` too. |
| 180 | pub fn multiply(&self, other: &Precision<usize>) -> Precision<usize> { |
| 181 | match (self, other) { |
| 182 | (Precision::Exact(a), Precision::Exact(b)) => a.checked_mul(*b).map_or_else( |
| 183 | || Precision::Inexact(a.saturating_mul(*b)), |
| 184 | Precision::Exact, |
| 185 | ), |
| 186 | (Precision::Inexact(a), Precision::Exact(b)) |
| 187 | | (Precision::Exact(a), Precision::Inexact(b)) |
| 188 | | (Precision::Inexact(a), Precision::Inexact(b)) => { |
| 189 | Precision::Inexact(a.saturating_mul(*b)) |
| 190 | } |
| 191 | (_, _) => Precision::Absent, |
| 192 | } |
| 193 | } |
| 194 | |
| 195 | /// Return the estimate of applying a filter with estimated selectivity |
| 196 | /// `selectivity` to this Precision. A selectivity of `1.0` means that all |
no test coverage detected