The way arithmetic methods round off and handle error conditions.
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
By default, the arithmetic methods use the
NSRound behavior; that is, the methods round to the closest possible return value. The methods assume your need for precision does not exceed 38 significant digits and raise exceptions when they try to divide by 0 or produce a number too big or too small to be represented.
If this default behavior doesn’t suit your application, you should use methods that let you specify the behavior, like
decimal. If you find yourself using a particular behavior consistently, you can specify a different default behavior with setDefaultBehavior:.
The default behavior is maintained separately for each thread in your app.