This repository was archived by the owner on Mar 29, 2018. It is now read-only.
-
Couldn't load subscription status.
- Fork 314
Float
pNre edited this page Jun 21, 2014
·
4 revisions
#Instance methods
abs () -> Float
Equivalent to
fabsf(self).
sqrt () -> Float
Equivalent to
sqrtf(self).
floor () -> Float
Equivalent to
floorf(self).
ceil () -> Float
Equivalent to
ceilf(self).
round () -> Float
Equivalent to
roundf(self).
digits () -> (integerPart: Int[], fractionalPart: Int[])
Returns couple of
Int[]: integer and fractional part ofself.
let f = 3.120
f.digits()
// → ([3], [1, 1, 9, ...])#Class methods
random(min: Float = 0, max: Float) -> Float
Returns a random
Floatbetweenminandmax(inclusive).
Float.random(min: 5, max: 10)
// → 5.302852