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

Side by Side Diff: runtime/lib/math_patch.dart

Issue 11770004: Rename Date to DateTime. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments and keep Backwards-compatibility class Date. Created 7 years, 11 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 | « runtime/lib/date_patch.dart ('k') | runtime/vm/snapshot_test.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 VM patch of the dart:math library. 5 // A VM patch of the dart:math library.
6 patch num pow(num x, num exponent) { 6 patch num pow(num x, num exponent) {
7 if (exponent is int) { 7 if (exponent is int) {
8 return x.pow(exponent); 8 return x.pow(exponent);
9 } 9 }
10 // Double.pow will call exponent.toDouble(). 10 // Double.pow will call exponent.toDouble().
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 static const _POW2_53_D = 1.0 * (1 << 53); 104 static const _POW2_53_D = 1.0 * (1 << 53);
105 105
106 static const _A = 0xffffda61; 106 static const _A = 0xffffda61;
107 107
108 // Use a singleton Random object to get a new seed if no seed was passed. 108 // Use a singleton Random object to get a new seed if no seed was passed.
109 static var _prng = null; 109 static var _prng = null;
110 110
111 static int _nextSeed() { 111 static int _nextSeed() {
112 if (_prng == null) { 112 if (_prng == null) {
113 // TODO(iposva): Use system to get a random seed. 113 // TODO(iposva): Use system to get a random seed.
114 _prng = new Random(new Date.now().millisecondsSinceEpoch); 114 _prng = new Random(new DateTime.now().millisecondsSinceEpoch);
115 } 115 }
116 // Trigger the PRNG once to change the internal state. 116 // Trigger the PRNG once to change the internal state.
117 return _prng._nextInt32(); 117 return _prng._nextInt32();
118 } 118 }
119 } 119 }
OLDNEW
« no previous file with comments | « runtime/lib/date_patch.dart ('k') | runtime/vm/snapshot_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698