Skip to content

Commit 475a6f1

Browse files
committed
use isFinite to test for infinities
1 parent f4245d0 commit 475a6f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/plots/smith/helpers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function smith(a) {
1212
var R = a[0];
1313
var X = a[1];
1414

15-
if(R === Infinity || Math.abs(X) === Infinity) return [1, 0];
15+
if(!isFinite(R) || !isFinite(X)) return [1, 0];
1616

1717
var D = (R + 1) * (R + 1) + X * X;
1818
return [(R * R + X * X - 1) / D, 2 * X / D];

0 commit comments

Comments
 (0)