| Index: src/js/math.js
|
| diff --git a/src/js/math.js b/src/js/math.js
|
| index 69afaaba823dd633ebed027b18d6962b184dd563..c17441db8064ec48c7f308a6e665060eb31acc90 100644
|
| --- a/src/js/math.js
|
| +++ b/src/js/math.js
|
| @@ -91,11 +91,6 @@ function MathRound(x) {
|
| return %RoundNumber(TO_NUMBER(x));
|
| }
|
|
|
| -// ECMA 262 - 15.8.2.17
|
| -function MathSqrtJS(x) {
|
| - return %_MathSqrt(+x);
|
| -}
|
| -
|
| // ES6 draft 09-27-13, section 20.2.2.28.
|
| function MathSign(x) {
|
| x = +x;
|
| @@ -119,9 +114,9 @@ function MathAsinh(x) {
|
| x = TO_NUMBER(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));
|
| + if (x > 0) return MathLog(x + %math_sqrt(x * x + 1));
|
| // This is to prevent numerical errors caused by large negative x.
|
| - return -MathLog(-x + %_MathSqrt(x * x + 1));
|
| + return -MathLog(-x + %math_sqrt(x * x + 1));
|
| }
|
|
|
| // ES6 draft 09-27-13, section 20.2.2.3.
|
| @@ -130,7 +125,7 @@ function MathAcosh(x) {
|
| if (x < 1) return NaN;
|
| // Idempotent for NaN and +Infinity.
|
| if (!NUMBER_IS_FINITE(x)) return x;
|
| - return MathLog(x + %_MathSqrt(x + 1) * %_MathSqrt(x - 1));
|
| + return MathLog(x + %math_sqrt(x + 1) * %math_sqrt(x - 1));
|
| }
|
|
|
| // ES6 draft 09-27-13, section 20.2.2.7.
|
| @@ -169,7 +164,7 @@ function MathHypot(x, y) { // Function length is 2.
|
| compensation = (preliminary - sum) - summand;
|
| sum = preliminary;
|
| }
|
| - return %_MathSqrt(sum) * max;
|
| + return %math_sqrt(sum) * max;
|
| }
|
|
|
| // ES6 draft 07-18-14, section 20.2.2.11
|
| @@ -234,7 +229,6 @@ utils.InstallFunctions(GlobalMath, DONT_ENUM, [
|
| "floor", MathFloorJS,
|
| "log", MathLog,
|
| "round", MathRound,
|
| - "sqrt", MathSqrtJS,
|
| "atan2", MathAtan2JS,
|
| "pow", MathPowJS,
|
| "sign", MathSign,
|
| @@ -254,7 +248,6 @@ utils.InstallFunctions(GlobalMath, DONT_ENUM, [
|
| %SetForceInlineFlag(MathFloorJS);
|
| %SetForceInlineFlag(MathRandom);
|
| %SetForceInlineFlag(MathSign);
|
| -%SetForceInlineFlag(MathSqrtJS);
|
| %SetForceInlineFlag(MathTrunc);
|
|
|
| // -------------------------------------------------------------------
|
|
|