Any data type conversion whether done implicitly, or done explicitly by casting or conversion functions must obey the following rules.
The target must be large enough so that there is no loss of digits to the left of the decimal point in the source value.
If the source value has decimal digits, the outcome depends upon the individual case described previously.
If the source is a character data type, it must contain a valid numeric literal.
The value of the source is rounded to the number of digits of precision of the target type (6 digits for REAL, 15 for DOUBLE PRECISION).
If the source is a character data type, it must contain a valid numeric literal.
The target must be large enough so that there is no loss of digits to the left of the decimal point in the source value.
The value of the source is rounded to the scale of the target type.
If the source is a character data type, it must contain a valid numeric literal.
The target must be large enough to hold all non-blank characters of the source value, left-justified in the target variable. This includes the formatted output of values from source numeric and timestamp data types.
If the source is not a timestamp data type (i.e., the source is a character data type or an integer data type in some limited circumstances), it must contain a valid date or timestamp literal.