MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / log10

Function log10

src/compute-engine/interval/elementary.ts:357–374  ·  view source on GitHub ↗
(x: Interval | IntervalResult)

Source from the content-addressed store, hash-verified

355 * Base-10 logarithm.
356 */
357export 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.

Callers

nothing calls this directly

Calls 2

unwrapOrPropagateFunction · 0.90
okFunction · 0.90

Tested by

no test coverage detected