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

Side by Side Diff: src/math.js

Issue 1599019: Change Math.random() to return 32 bits of random goodness, instead of 30 rand... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « src/ia32/codegen-ia32.cc ('k') | src/mips/codegen-mips.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 158
159 // ECMA 262 - 15.8.2.13 159 // ECMA 262 - 15.8.2.13
160 function MathPow(x, y) { 160 function MathPow(x, y) {
161 if (!IS_NUMBER(x)) x = ToNumber(x); 161 if (!IS_NUMBER(x)) x = ToNumber(x);
162 if (!IS_NUMBER(y)) y = ToNumber(y); 162 if (!IS_NUMBER(y)) y = ToNumber(y);
163 return %_MathPow(x, y); 163 return %_MathPow(x, y);
164 } 164 }
165 165
166 // ECMA 262 - 15.8.2.14 166 // ECMA 262 - 15.8.2.14
167 function MathRandom() { 167 function MathRandom() {
168 return %_RandomPositiveSmi() / 0x40000000; 168 return %_RandomHeapNumber();
169 } 169 }
170 170
171 // ECMA 262 - 15.8.2.15 171 // ECMA 262 - 15.8.2.15
172 function MathRound(x) { 172 function MathRound(x) {
173 if (!IS_NUMBER(x)) x = ToNumber(x); 173 if (!IS_NUMBER(x)) x = ToNumber(x);
174 return %RoundNumber(x); 174 return %RoundNumber(x);
175 } 175 }
176 176
177 // ECMA 262 - 15.8.2.16 177 // ECMA 262 - 15.8.2.16
178 function MathSin(x) { 178 function MathSin(x) {
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 "tan", MathTan, 255 "tan", MathTan,
256 "atan2", MathAtan2, 256 "atan2", MathAtan2,
257 "pow", MathPow, 257 "pow", MathPow,
258 "max", MathMax, 258 "max", MathMax,
259 "min", MathMin 259 "min", MathMin
260 )); 260 ));
261 }; 261 };
262 262
263 263
264 SetupMath(); 264 SetupMath();
OLDNEW
« no previous file with comments | « src/ia32/codegen-ia32.cc ('k') | src/mips/codegen-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698