Files
sdk/tests/lib/math/random_big_test.dart
Stephen Adams 3205f60a75 Avoid shift in math/random_big_test
Change-Id: Ia9475b6aaa2c5bb7f93c98e0676f83ca7c3762b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175104
Auto-Submit: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-12-04 23:46:34 +00:00

20 lines
583 B
Dart

// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Test that Random can deal with a seed at upper end of 64-bit range.
import "package:expect/expect.dart";
import 'dart:math';
main() {
var results = [];
for (var i = 60; i < 64; i++) {
var rng = new Random(pow(2, i) as int);
var val = rng.nextInt(100000);
print("$i: $val");
Expect.isFalse(results.contains(val));
results.add(val);
}
}