8db30180b4
- Use all bits from the seed value even if passed a Bigint. - Fix out of bounds access in BigintOperations. - Remove obsolete implementation note. R=srdjan@google.com Review URL: https://codereview.chromium.org//136453012 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31859 260f80e4-7a28-3924-810f-c04153c831b5
23 lines
632 B
Dart
23 lines
632 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 outside 64-bit range.
|
|
|
|
// Library tag to allow Dartium to run the test.
|
|
library random_big;
|
|
|
|
import "package:expect/expect.dart";
|
|
import 'dart:math';
|
|
|
|
main() {
|
|
var results = [];
|
|
for(var i = 60; i < 80; i++) {
|
|
var rng = new Random(1<<i);
|
|
var val = rng.nextInt(100000);
|
|
print("$i: $val");
|
|
Expect.isFalse(results.contains(val));
|
|
results.add(val);
|
|
}
|
|
}
|