Real
See Also: Type Conversion Functions, Integer, Number, Round, String
Purpose
The Real function returns a value of type Real from a source of another data type.
Return Type
Syntax
(Real({expression}))
What It Does
Real returns floating point (real) values from sources of other types.
Procedure Test
Number nSide
Real rArea
Move 6.567 To nSide
Move (Real(nSide ^ 2)) To rArea
End_Procedure
In this example, the value of the number variable nSide is squared and moved to the real variable rArea in floating-point precision.
Real does not change the type of any value. It only affects the precision to which an expression is evaluated.
Notes
- When used inside an expression, Real affects the precision of the overall expression, unless a function converting to a lower order of precision contains the Real expression.
Number nSum nPopulation
Real rMean
Move (Real(nSum / nPopulation)) To rMean
This example would output the quotient of nSum divided by nPopulation to the real variable rMean in full floating point precision.