|
@@ -37,7 +37,19 @@ extern class Math {
|
|
|
public static function max (i : Float, j :Float) : Float;
|
|
|
public static function min (i : Float, j :Float) : Float;
|
|
|
|
|
|
- public static function random() : Float;
|
|
|
- public static function randomseed(i : Float) : Float;
|
|
|
+ /**
|
|
|
+ This function is an interface to the simple pseudo-random generator function rand provided by ANSI C.
|
|
|
+ (No guarantees can be given for its statistical properties.)
|
|
|
+
|
|
|
+ When called without arguments, returns a uniform pseudo-random real number in the range [0,1).
|
|
|
+ When called with an integer number `m`, returns a uniform pseudo-random integer in the range [1, m].
|
|
|
+ When called with two integer numbers `m` and `n`, returns a uniform pseudo-random integer in the range [m, n].
|
|
|
+ **/
|
|
|
+ public static function random(?m:Float, ?n:Float) : Float;
|
|
|
+
|
|
|
+ /**
|
|
|
+ Sets `x` as the "seed" for the pseudo-random generator: equal seeds produce equal sequences of numbers.
|
|
|
+ **/
|
|
|
+ public static function randomseed(x : Float) : Float;
|
|
|
}
|
|
|
|