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

Side by Side Diff: lib/math/random.dart

Issue 10538105: Make isUtc a getter, change some method names in Date. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 years, 6 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 | « lib/compiler/implementation/ssa/tracer.dart ('k') | runtime/bin/file_impl.dart » ('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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // A part of the dart:math library. 5 // A part of the dart:math library.
6 6
7 /** 7 /**
8 * A random number generator. The default implementation supplies a stream of 8 * A random number generator. The default implementation supplies a stream of
9 * pseudo-random bits which is not suitable for cryptographic purposes. 9 * pseudo-random bits which is not suitable for cryptographic purposes.
10 */ 10 */
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 static final _POW2_32 = 1 << 32; 91 static final _POW2_32 = 1 << 32;
92 static final _POW2_53_D = 1.0 * (1 << 53); 92 static final _POW2_53_D = 1.0 * (1 << 53);
93 93
94 static final _A = 0xffffda61; 94 static final _A = 0xffffda61;
95 95
96 var _state; 96 var _state;
97 97
98 int _nextSeed() { 98 int _nextSeed() {
99 if (_prng == null) { 99 if (_prng == null) {
100 // TODO(iposva): Use system to get a random seed. 100 // TODO(iposva): Use system to get a random seed.
101 _prng = new _Random(new Date.now().value); 101 _prng = new _Random(new Date.now().millisecondsSinceEpoch);
102 } 102 }
103 // Trigger the PRNG once to change the internal state. 103 // Trigger the PRNG once to change the internal state.
104 _prng._nextInt32(); 104 _prng._nextInt32();
105 return _prng._state; 105 return _prng._state;
106 } 106 }
107 107
108 static var _prng = null; 108 static var _prng = null;
109 } 109 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/ssa/tracer.dart ('k') | runtime/bin/file_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698