Files
sdk/lib/math/random.dart
T
ager@google.com 652415daaf Cleanup of math sources.
Get rid of temporary unified directory version. Move back into
lib/math where it should be.

Rename patch files from the for math.dartp to the form
math_patch.dart.  They are just dart files and I don't like the new
dartp extension.

R=ajohnsen@google.com,lrn@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10831324

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10709 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-15 11:25:40 +00:00

41 lines
1.3 KiB
Dart

// Copyright (c) 2012, 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.
// A part of the dart:math library.
/**
* A random number generator. The default implementation supplies a stream of
* pseudo-random bits which is not suitable for cryptographic purposes.
*/
class Random {
/**
* Creates a random-number generator. The optional parameter [seed] is used
* to initialize the internal state of the generator. The implementation of
* the random stream can change between releases of the library.
*
* Implementation note: The default implementation uses up to 64-bits of seed.
*/
external factory Random([int seed]);
/**
* Generates a positive random integer uniformly distributed on the range
* from 0, inclusive, to [max], exclusive.
*
* Implementation note: The default implementation supports [max] values
* between 1 and ((1<<32) - 1) inclusive.
*/
abstract int nextInt(int max);
/**
* Generates a positive random floating point value uniformly distributed on
* the range from 0.0, inclusive, to 1.0, exclusive.
*/
abstract double nextDouble();
/**
* Generates a random boolean value.
*/
abstract bool nextBool();
}