Adds two decimal values.
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+Beta
- tvOS 9.0+
- watchOS 2.0+
right and stores the sum in
Decimal instances can represent a number with up to 38 significant digits. If a number is more precise than that, it must be rounded off.
rounding determines how to round it off. There are four possible rounding modes:
The return value indicates whether any machine limitations were encountered in the addition. If none were encountered, the function returns
NSCalculation. Otherwise it may return one of the following values:
NSCalculation. For descriptions of all these error conditions, see
exception in NSDecimalNumberBehaviors.
For more information, see Number and Value Programming Topics.