Float

superclass: SimpleNumber

A 64 bit double precision floating point number. Float inherits most of its behaviour from its superclass.

Random Numbers

coin

Answers a Boolean which is the result of a random test whose probability of success in a range from

zero to one is this.

Testing

isFloat

Answer true since this is a Float.

Converting

asFloat

Answer this since this is a Float.

asStringPrec(precision)

Returns a string representation of the number, with the desired precision (i.e. number of significant figures).

pi

pi.asStringPrec(3)

pi.asStringPrec(6)

(pi * 0.0001).asStringPrec(3)

7.4.asStringPrec(5)

7.4.asStringPrec(50)