DADiSP Worksheet Functions > Function Categories > Data Type Conversion > CASTREAL
Explicitly casts the input to a real value.
CASTREAL(val)
val |
- |
A scalar, series or table. |
A real value.
castreal(1)
returns the value 1.0.
castreal(0.2 + 8i)
returns the value 0.2.
CASTREAL is helpful when writing SPL functions that require an explicit real input and the type of the variable passed into the function may not be a real.
If the input to CASTREAL is a series, it will only operate on the first point of the series.
If the input to CASTREAL is a table, it will only operate on the first point in the first column of the table.