Contents Previous Next Subchapters

Conversion To Double-Precision
Syntax double(value)
See Also mlmode_real , real , complex , coercion

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

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

In Mlmode this function is called real instead of double. If in Mlmode you enter
     x = real(1 + 1*i)
O-Matrix will set x to the double-precision representation of the value 1.