Contents Previous Next Subchapters Current Chapters-> type int real double complex char logical matchtype Parent Chapters-> Omatrix6 elementary matrixType double Search Tools-> contents reference index search

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

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

Example ```      double(1) ``` returns ```      1 ``` 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 ```      1.5 ``` If value is a character matrix, `double` will return the ASCII value of each element of value. ```      double("mno") ``` returns ```      [ 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 ```      double(true) ``` O-Matrix will respond ```      1 ```
Mlmode
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`.