NSDecimalNumber
An object for representing and performing arithmetic on base-10 numbers.
Declaration
class NSDecimalNumberOverview
In Swift, this object bridges to Decimal; use NSDecimalNumber when you need reference semantics or other Foundation-specific behavior.
NSDecimalNumber, an immutable subclass of NSNumber, provides an object-oriented wrapper for doing base-10 arithmetic. An instance can represent any number that can be expressed as mantissa x 10^exponent where mantissa is a decimal integer up to 38 digits long, and exponent is an integer from –128 through 127.
Topics
Creating a Decimal Number
Initializing a Decimal Number
Performing Arithmetic
adding(_:)subtracting(_:)multiplying(by:)dividing(by:)raising(toPower:)multiplying(byPowerOf10:)adding(_:withBehavior:)subtracting(_:withBehavior:)multiplying(by:withBehavior:)dividing(by:withBehavior:)raising(toPower:withBehavior:)multiplying(byPowerOf10:withBehavior:)