(x: Interval | IntervalResult)
| 355 | * Base-10 logarithm. |
| 356 | */ |
| 357 | export function log10(x: Interval | IntervalResult): IntervalResult { |
| 358 | const unwrapped = unwrapOrPropagate(x); |
| 359 | if (!Array.isArray(unwrapped)) return unwrapped; |
| 360 | const [xVal] = unwrapped; |
| 361 | if (xVal.hi <= 0) { |
| 362 | return { kind: 'empty' }; |
| 363 | } |
| 364 | |
| 365 | if (xVal.lo > 0) { |
| 366 | return ok({ lo: Math.log10(xVal.lo), hi: Math.log10(xVal.hi) }); |
| 367 | } |
| 368 | |
| 369 | return { |
| 370 | kind: 'partial', |
| 371 | value: { lo: -Infinity, hi: Math.log10(xVal.hi) }, |
| 372 | domainClipped: 'lo', |
| 373 | }; |
| 374 | } |
| 375 | |
| 376 | /** |
| 377 | * Base-2 logarithm. |
nothing calls this directly
no test coverage detected