Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(410)

Unified Diff: src/harmony-math.js

Issue 159353003: Harmony: fix spec violation in Math.cosh. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: removed outdated comment. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/harmony/math-hyperbolic.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/harmony-math.js
diff --git a/src/harmony-math.js b/src/harmony-math.js
index d57a10404259eec07094930e61fd161fb58c6428..ee426ef1191f417b2178b17581c1a516704ecaab 100644
--- a/src/harmony-math.js
+++ b/src/harmony-math.js
@@ -59,8 +59,7 @@ function MathSinh(x) {
// ES6 draft 09-27-13, section 20.2.2.12.
function MathCosh(x) {
if (!IS_NUMBER(x)) x = NonNumberToNumber(x);
- // Idempotent for NaN and +/-Infinity.
- if (!NUMBER_IS_FINITE(x)) return x;
+ if (!NUMBER_IS_FINITE(x)) return MathAbs(x);
return (MathExp(x) + MathExp(-x)) / 2;
}
« no previous file with comments | « no previous file | test/mjsunit/harmony/math-hyperbolic.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698