Packagelaya.d3.math
Classpublic class Rand
InheritanceRand Inheritance Object

Rand 类用于通过32位无符号整型随机种子创建随机数。



Public Properties
 PropertyDefined By
  seed : uint
获取随机种子。
Rand
  seeds : Uint32Array
获取随机种子。
Rand
Public Methods
 MethodDefined By
  
Rand(seed:uint)
创建一个 Rand 实例。
Rand
  
getByteFromInt(v:uint):Number
[static] 通过无符号32位整形,获取无符号8位字节随机数。
Rand
  
getFloat():Number
获取0到1之间的浮点随机数。
Rand
  
getFloatFromInt(v:uint):Number
[static] 通过无符号32位整形,获取32位浮点随机数。
Rand
  
获取-1到1之间的浮点随机数。
Rand
  
getUint():Number
获取无符号32位整形随机数。
Rand
Property Detail
seedproperty
seed:uint

获取随机种子。


Implementation
    public function get seed():uint
    public function set seed(value:uint):void
seedsproperty 
public var seeds:Uint32Array

获取随机种子。

Constructor Detail
Rand()Constructor
public function Rand(seed:uint)

创建一个 Rand 实例。

Parameters
seed:uint — 32位无符号整型随机种子。
Method Detail
getByteFromInt()method
public static function getByteFromInt(v:uint):Number

通过无符号32位整形,获取无符号8位字节随机数。

Parameters

v:uint

Returns
Number — 无符号8位字节随机数。
getFloat()method 
public function getFloat():Number

获取0到1之间的浮点随机数。

Returns
Number — 0到1之间的浮点随机数。
getFloatFromInt()method 
public static function getFloatFromInt(v:uint):Number

通过无符号32位整形,获取32位浮点随机数。

Parameters

v:uint

Returns
Number — 32位浮点随机数。
getSignedFloat()method 
public function getSignedFloat():Number

获取-1到1之间的浮点随机数。

Returns
Number — -1到1之间的浮点随机数。
getUint()method 
public function getUint():Number

获取无符号32位整形随机数。

Returns
Number — 无符号32位整形随机数。