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

Side by Side Diff: src/js/math.js

Issue 1678303002: [es7] implement exponentiation operator proposal (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Try to make MSVC happy Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 (function(global, utils) { 5 (function(global, utils) {
6 "use strict"; 6 "use strict";
7 7
8 %CheckIsBootstrapping(); 8 %CheckIsBootstrapping();
9 9
10 // ------------------------------------------------------------------- 10 // -------------------------------------------------------------------
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 var approx_hi = MathFloorJS(%_DoubleHi(x) / 3) + 0x2A9F7893; 195 var approx_hi = MathFloorJS(%_DoubleHi(x) / 3) + 0x2A9F7893;
196 var approx = %_ConstructDouble(approx_hi | 0, 0); 196 var approx = %_ConstructDouble(approx_hi | 0, 0);
197 approx = NEWTON_ITERATION_CBRT(x, approx); 197 approx = NEWTON_ITERATION_CBRT(x, approx);
198 approx = NEWTON_ITERATION_CBRT(x, approx); 198 approx = NEWTON_ITERATION_CBRT(x, approx);
199 approx = NEWTON_ITERATION_CBRT(x, approx); 199 approx = NEWTON_ITERATION_CBRT(x, approx);
200 return NEWTON_ITERATION_CBRT(x, approx); 200 return NEWTON_ITERATION_CBRT(x, approx);
201 } 201 }
202 202
203 // ------------------------------------------------------------------- 203 // -------------------------------------------------------------------
204 204
205 %InstallToContext([
206 "math_pow", MathPowJS,
207 ]);
208
205 %AddNamedProperty(GlobalMath, toStringTagSymbol, "Math", READ_ONLY | DONT_ENUM); 209 %AddNamedProperty(GlobalMath, toStringTagSymbol, "Math", READ_ONLY | DONT_ENUM);
206 210
207 // Set up math constants. 211 // Set up math constants.
208 utils.InstallConstants(GlobalMath, [ 212 utils.InstallConstants(GlobalMath, [
209 // ECMA-262, section 15.8.1.1. 213 // ECMA-262, section 15.8.1.1.
210 "E", 2.7182818284590452354, 214 "E", 2.7182818284590452354,
211 // ECMA-262, section 15.8.1.2. 215 // ECMA-262, section 15.8.1.2.
212 "LN10", 2.302585092994046, 216 "LN10", 2.302585092994046,
213 // ECMA-262, section 15.8.1.3. 217 // ECMA-262, section 15.8.1.3.
214 "LN2", 0.6931471805599453, 218 "LN2", 0.6931471805599453,
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 // Exports 261 // Exports
258 262
259 utils.Export(function(to) { 263 utils.Export(function(to) {
260 to.MathAbs = MathAbs; 264 to.MathAbs = MathAbs;
261 to.MathExp = MathExp; 265 to.MathExp = MathExp;
262 to.MathFloor = MathFloorJS; 266 to.MathFloor = MathFloorJS;
263 to.IntRandom = MathRandomRaw; 267 to.IntRandom = MathRandomRaw;
264 }); 268 });
265 269
266 }) 270 })
OLDNEW
« no previous file with comments | « src/flag-definitions.h ('k') | src/parsing/parser.h » ('j') | src/parsing/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698