Skip to content
This repository has been archived by the owner on Mar 29, 2018. It is now read-only.
pNre edited this page Jun 15, 2014 · 4 revisions

Contents

#Instance methods

abs

  • abs () -> Float

Absolute value of self.

Example

let f = -10.0
f.abs()
// → 10.0

sqrt

  • sqrt () -> Float

Squared root of self.

Example

let f = 9.0
f.sqrt()
// → 3

#Class methods

random

  • random(min: Float = 0, max: Float) -> Float

Returns a random Float between min and max (inclusive).

Example

Float.random(min: 5, max: 10)
// → 5.302852
Clone this wiki locally