2008年4月30日 星期三

math methods

abs:
ex:
-3.abs
--> 3

zero?
tell if the number is zero
ex:
3.zero?
--> false

rand:
ex:
rand(100)
return an random integer from 0 to 99

round:
ex:
3.1.round 
--> 3
3.5.round 
--->4

沒有留言: