Arithmetic Operations on Decimal Data Types
In expressions that combine decimal values and return decimal results, the precision (total number of digits) and scale (number of digits to the right of the decimal point) of the result can be determined, as shown in the following table:
For example, in the following decimal addition operation:
1.234 + 567.89
the scale and precision of the result is calculated as follows:
Precision = 7
Calculated as 3 (largest number of fractional digits) + 3 (largest number of non-fractional digits) + 1 = 7
Scale = 3
The first operand has the largest number of digits to the right of the decimal point.
Result:
0569.124
If exponentiation is performed on a decimal value, the resulting data type is float.