Variables used in programming
Constants and Variables
Constants and variables are building blocks with which operators and
functions produce results. A constant is a value that does not change during
the execution of a program. A variable is a location with a name that contains
a scalar or array value. During the execution of a program or an interactive
terminal session, numbers, strings, or arrays can be stored in variables
and used in future computations.
Basic Data Types
In IDL there are eight 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. Byte, Integer and Long integers
can be represented using decimal, hexadecimal
and octal notation.
-
Byte: An 8-bit unsigned integer ranging in value from 0 to 255. Pixels
in images are commonly represented as byte data.
-
Integer: A 16-bit signed integer ranging from -32,768 to +32,767.
-
Long: A 32-bit signed integer ranging in value from approximately minus
two billion to plus two billion.
-
Floating-point: A 32-bit, single-precision, floating-point number in the
range of ± 10^38, with approximately six or seven decimal
places of significance.
-
Double-precision: A 64-bit, double-precision, floating-point number in
the range of ± 10^38 on VMS systems (note that IDL for AlphaVMS
does not use IEEE math), and ±10^308 on machines supporting the
IEEE standard, with approximately 14 decimal places of significance.
-
Complex: A real-imaginary pair of single-precision, floating-point numbers.
Complex numbers are useful for signal processing and frequency domain filtering.
-
Double-precision complex: A real-imaginary pair of double-precision, floating-point
numbers.
-
String: A sequence of characters, from 0 to 32,767 characters in length,
which is interpreted as text.