Type:
REAL: simple -> real
Call syntax:
REAL(anObject)
Description:
REAL converts boolean,
integer,
real,
and string objects into real values.
The boolean values FALSE
and TRUE
are converted into 0.0
and 1.0.
string values are interpreted as real values, if a string value does not correspond to a valid real value, REAL returns 0.0.
Attention!
Due to the binary internal representation of real
values, REAL conversions can be slightly unprecise.
Example:
> REAL(TRUE)
Result= 1.00000000
> REAL(2.3)
Result= 2.29999995
> REAL("hallo")
Result= 0.00000000
> REAL("2a")
Result= 2.00000000
> REAL(2a)
Error in command-line:
parse error
See also: