The IDL language is dynamically typed. This means that an operation on a variable can change that variable's type. In general, when variables of different types are combined in an expression, the result has the data type that yields the highest precision.
For example, if an integer variable is added to a floating-point variable, the result will be a floating-point variable.
In IDL there are twelve basic, atomic data types, each with its own form of constant. The data type assigned to a variable is determined either by the syntax used when creating the variable, or as a result of some operation that changes the type of the variable.
IDL's basic data types are discussed in more detail beginning with Constants.
The precision of IDL's floating-point numbers depends somewhat on the platform involved and the compiler and specific compiler switches used to compile the IDL executable. The values shown here are minimum values; in some cases, IDL may deliver slightly more precision than we have indicated. If your application uses numbers that are sensitive to floating-point truncation or round-off errors, or values that cannot be represented exactly as floating-point numbers, this is something you should consider.
For more information on floating-point mathematics, see Mathematics. For information on your machine's precision, see MACHAR.
The SIZE function can be used to determine the data type of a variable. See Determining the Size/Type of an Array for an example.