Std
You are viewing an old version of this entry, click here to see latest version.
class StdAvailable in flash, flash9, neko, js, phpThe Std class provides standard methods for manipulating basic types.
static function int( x : Float ) : IntConvert a Float to an Int, rounded down.
static function is( v : Dynamic, t : Dynamic ) : BoolTells if a value v is of the type t.
static function parseFloat( x : String ) : FloatConvert a String to a Float, parsing different possible reprensations.
static function parseInt( x : String ) : Null<Int>Convert a String to an Int, parsing different possible representations. Returns
null if could not be parsed.
static function random( x : Int ) : IntReturn a random integer between 0 included and x excluded.
static function string( s : Dynamic ) : StringConvert any value to a String
version #2481, modified 2008-07-28 10:02:48 by api
2 comments
The random function doesn't seem that random. Generated a few hundred numbers with it and the propability to generate a low number is much higher than the propability of generating a higher number. This seems to happen on most platforms.
Oops, error between chair and keyboard. Disregard comment