If either operand of an arithmetic operator is decimal floating-point, the operation is performed in decimal floating-point.
If one
operand is a small integer
or integer
and the
other is DECFLOAT, the operation is performed in DECFLOAT(n) using
a temporary copy of the integer that has been converted to a DECFLOAT(n)
number. If one operand is a big integer and the other is DECFLOAT,
then a temporary copy of the big integer is converted to a DECFLOAT(34)
number. The rules for two DECFLOAT operands are then applied.
If one operand is a decimal and the other is DECFLOAT, the operation is performed in DECFLOAT using a temporary copy of the decimal number that has been converted to a DECFLOAT number based on the precision of the decimal number. If the decimal number has a precision < 17, the decimal number is converted to DECFLOAT(16). Otherwise, the decimal number is converted to a DECFLOAT(34) number. The rules for two DECFLOAT operands are then applied.
If one operand is floating-point (real or double) and the other is DECFLOAT, the operation is performed in DECFLOAT(n) using a temporary copy of the floating-point number that has been converted to a DECFLOAT(n) number.
If both operands are DECFLOAT(n), the operation is performed in DECFLOAT(n). If one operand is DECFLOAT(16) and the other is DECFLOAT(34), the operation is performed in DECFLOAT(34).