Skip to content

[LEMS-3953/pr2-logarithm-kmath] [Interactive Graph] Add logarithm mat…

4f8ea19
Select commit
Loading
Failed to load commit list.
Merged

[Interactive Graph] Add logarithm math utilities to kmath #3421

[LEMS-3953/pr2-logarithm-kmath] [Interactive Graph] Add logarithm mat…
4f8ea19
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Apr 7, 2026 in 13m 39s

Code review found 1 potential issue

Found 5 candidates, confirmed 1. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 1
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit packages/kmath/src/coefficients.ts:126-143 Missing isFinite check on final logarithm coefficients

Annotations

Check warning on line 143 in packages/kmath/src/coefficients.ts

See this annotation in the file changed.

@claude claude / Claude Code Review

Missing isFinite check on final logarithm coefficients

getLogarithmCoefficients checks isFinite on intermediate values (bExp, aExp) but not on the final returned coefficients (a, b, c), allowing 1/bExp or 1/aExp to silently produce Infinity when those intermediates are tiny but non-zero. This is inconsistent with getExponentialCoefficients, which validates isFinite on a and b after computation; adding isFinite(a) && isFinite(b) && isFinite(c) after the inversion step would mirror the established defensive pattern.