Next: Minimum and Maximum Up: Arithmetic Intrinsic Functions Previous: Other Transcendental Functions

Type Conversion Functions

These functions can be used to convert from any of the four arithmetic data types to any of the others. They are used automatically whenever mixed data types are encountered in arithmetic expressions and assignments.

 I = INT(IRDX) converts to integer by truncation. R = REAL(IRDX) converts to real. D = DBLE(IRDX) converts to double precision. X = CMPLX(IRDX) converts to complex. X = CMPLX(IRD,IRD) converts to complex.

The integer conversion of INT rounds towards zero; if you need to round to the nearest integer use the NINT function (described below). The CMPLX function produces a value with a zero imaginary component unless it is used with two arguments (or one which is already complex). It is important to realise that many conversions lose information: in particular a double precision value is likely to lose significant digits if converted to any other data type.

Helen Rowlands
8/27/1998