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

Unified Diff: runtime/lib/math_patch.dart

Issue 15356003: - Extend the coin test for slightly different scenarios. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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 | tests/lib/math/coin_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/math_patch.dart
===================================================================
--- runtime/lib/math_patch.dart (revision 23308)
+++ runtime/lib/math_patch.dart (working copy)
@@ -49,7 +49,11 @@
do {
seed = (seed + 0x5A17) & _Random._MASK_64;
} while (seed == 0);
- return new _Random._internal(seed);
+ // Crank a couple of times to distribute the seed bits a bit further.
+ return new _Random._internal(seed).._nextState()
+ .._nextState()
+ .._nextState()
+ .._nextState();
}
}
« no previous file with comments | « no previous file | tests/lib/math/coin_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698