[Interactive Graph] Add logarithm math utilities to kmath #3421
+158
−0
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
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.
Loading