Function
_mul
(a: Interval, b: Interval)
Source from the content-addressed store, hash-verified
| 61 | * Used by div() and other operations that need plain interval results. |
| 62 | */ |
| 63 | export function _mul(a: Interval, b: Interval): Interval { |
| 64 | const products = [ |
| 65 | _prod(a.lo, b.lo), |
| 66 | _prod(a.lo, b.hi), |
| 67 | _prod(a.hi, b.lo), |
| 68 | _prod(a.hi, b.hi), |
| 69 | ]; |
| 70 | return { lo: Math.min(...products), hi: Math.max(...products) }; |
| 71 | } |
| 72 | |
| 73 | /** |
| 74 | * Endpoint product using the interval convention `0 · ±∞ = 0`. |
Tested by
no test coverage detected