Contents Previous Next Subchapters

Conversion To Single-Precision
Syntax real(value)
See Also mlmode_real , isreal , int , double , coercion

Description
Returns the element-by-element conversion of value to a single-precision number.

Example
     real(1)
returns
     1
If value is complex, real will return only the real part of value. (Note that double will return the same value but in the same precision as a complex value.) If you enter
     real(1.5r0 + 2.1i0)
O-Matrix will return
     1.5
If value is a character matrix, real will return the ASCII value of each element of value.
     real("xyz")
returns
     [ 120 , 121 , 122 ]
If value is a logical matrix, real will return 1 for each true element and 0 for each false element. If you enter
     real(false)
O-Matrix will respond
     0