Skip to content

Commit 513a199

Browse files
committed
Merge branch 'master' of github.com:kvz/phpjs
Conflicts: functions/math/hypot.js
2 parents 91efc2c + 2226f35 commit 513a199

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

functions/math/hypot.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function hypot(x, y) {
55
// example 1: hypot(3, 4);
66
// returns 1: 5
77
// example 2: hypot([], 'a');
8-
// returns 2: 0
8+
// returns 2: null
99

1010
x = Math.abs(x);
1111
y = Math.abs(y);
@@ -14,5 +14,5 @@ function hypot(x, y) {
1414
x = Math.max(x, y);
1515
t = t / x;
1616

17-
return x * Math.sqrt(1 + t * t);
18-
}
17+
return x * Math.sqrt(1 + t * t) || null;
18+
}

0 commit comments

Comments
 (0)