Index: src/math.js |
diff --git a/src/math.js b/src/math.js |
index 04c27b606f02f6fab65034b13677c1542c13769b..16083d791e8a9d4197f01f9cbccaddd9c7b08743 100644 |
--- a/src/math.js |
+++ b/src/math.js |
@@ -88,7 +88,7 @@ |
var r = -INFINITY; |
for (var i = 0; i < length; i++) { |
var n = %_Arguments(i); |
- if (!IS_NUMBER(n)) n = NonNumberToNumber(n); |
+ n = TO_NUMBER_INLINE(n); |
// Make sure +0 is considered greater than -0. |
if (NUMBER_IS_NAN(n) || n > r || (r === 0 && n === 0 && %_IsMinusZero(r))) { |
r = n; |
@@ -115,7 +115,7 @@ |
var r = INFINITY; |
for (var i = 0; i < length; i++) { |
var n = %_Arguments(i); |
- if (!IS_NUMBER(n)) n = NonNumberToNumber(n); |
+ n = TO_NUMBER_INLINE(n); |
// Make sure -0 is considered less than +0. |
if (NUMBER_IS_NAN(n) || n < r || (r === 0 && n === 0 && %_IsMinusZero(n))) { |
r = n; |
@@ -175,7 +175,7 @@ |
// ES6 draft 09-27-13, section 20.2.2.33. |
function MathTanh(x) { |
- if (!IS_NUMBER(x)) x = NonNumberToNumber(x); |
+ x = TO_NUMBER_INLINE(x); |
// Idempotent for +/-0. |
if (x === 0) return x; |
// Returns +/-1 for +/-Infinity. |
@@ -187,7 +187,7 @@ |
// ES6 draft 09-27-13, section 20.2.2.5. |
function MathAsinh(x) { |
- if (!IS_NUMBER(x)) x = NonNumberToNumber(x); |
+ x = TO_NUMBER_INLINE(x); |
// Idempotent for NaN, +/-0 and +/-Infinity. |
if (x === 0 || !NUMBER_IS_FINITE(x)) return x; |
if (x > 0) return MathLog(x + %_MathSqrt(x * x + 1)); |
@@ -197,7 +197,7 @@ |
// ES6 draft 09-27-13, section 20.2.2.3. |
function MathAcosh(x) { |
- if (!IS_NUMBER(x)) x = NonNumberToNumber(x); |
+ x = TO_NUMBER_INLINE(x); |
if (x < 1) return NAN; |
// Idempotent for NaN and +Infinity. |
if (!NUMBER_IS_FINITE(x)) return x; |
@@ -206,7 +206,7 @@ |
// ES6 draft 09-27-13, section 20.2.2.7. |
function MathAtanh(x) { |
- if (!IS_NUMBER(x)) x = NonNumberToNumber(x); |
+ x = TO_NUMBER_INLINE(x); |
// Idempotent for +/-0. |
if (x === 0) return x; |
// Returns NaN for NaN and +/- Infinity. |
@@ -224,7 +224,7 @@ |
var max = 0; |
for (var i = 0; i < length; i++) { |
var n = %_Arguments(i); |
- if (!IS_NUMBER(n)) n = NonNumberToNumber(n); |
+ n = TO_NUMBER_INLINE(n); |
if (n === INFINITY || n === -INFINITY) return INFINITY; |
n = MathAbs(n); |
if (n > max) max = n; |
@@ -261,7 +261,7 @@ |
// Using initial approximation adapted from Kahan's cbrt and 4 iterations |
// of Newton's method. |
function MathCbrt(x) { |
- if (!IS_NUMBER(x)) x = NonNumberToNumber(x); |
+ x = TO_NUMBER_INLINE(x); |
if (x == 0 || !NUMBER_IS_FINITE(x)) return x; |
return x >= 0 ? CubeRoot(x) : -CubeRoot(-x); |
} |