Numbers are compared algebraically; that is, with regard to sign. For example, -2 is less than +1.
If one number is an integer and the other number is decimal, the comparison is made with a temporary copy of the integer that has been converted to decimal.
When decimal or nonzero scale binary numbers with different scales are compared, the comparison is made with a temporary copy of one of the numbers that has been extended with trailing zeros so that its fractional part has the same number of digits as the other number.
If one number is floating point and the other is integer, decimal, or single-precision floating point, the comparison is made with a temporary copy of the second number converted to a double-precision floating-point number. However, if a single-precision floating-point column is compared to a constant and the constant can be represented by a single-precision floating-point number, the comparison is made with a single-precision form of the constant.
Two floating-point numbers are equal only if the bit configurations of their normalized forms are identical.
When string and numeric data types are compared, the string is converted to the numeric data type and must contain a valid string representation of a number.
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.