Instance Method

adding(_:)

Adds this number to another given number.

Declaration

func adding(_ decimalNumber: NSDecimalNumber) -> NSDecimalNumber

Parameters

decimalNumber

The number to add to the receiver.

Return Value

A new NSDecimalNumber object whose value is the sum of the receiver and decimalNumber.

Discussion

This method uses the default behavior when handling calculation errors and rounding.

See Also

Performing Arithmetic

func subtracting(NSDecimalNumber) -> NSDecimalNumber

Subtracts another given number from this one.

func multiplying(by: NSDecimalNumber) -> NSDecimalNumber

Multiplies the number by another given number.

func dividing(by: NSDecimalNumber) -> NSDecimalNumber

Divides the number by another given number.

func raising(toPower: Int) -> NSDecimalNumber

Raises the number to a given power.

func multiplying(byPowerOf10: Int16) -> NSDecimalNumber

Multiplies the number by 10 raised to the given power.

func adding(NSDecimalNumber, withBehavior: NSDecimalNumberBehaviors?) -> NSDecimalNumber

Adds this number to another given number using the specified behavior.

func subtracting(NSDecimalNumber, withBehavior: NSDecimalNumberBehaviors?) -> NSDecimalNumber

Subtracts this a given number from this one using the specified behavior.

func multiplying(by: NSDecimalNumber, withBehavior: NSDecimalNumberBehaviors?) -> NSDecimalNumber

Multiplies this number by another given number using the specified behavior.

func dividing(by: NSDecimalNumber, withBehavior: NSDecimalNumberBehaviors?) -> NSDecimalNumber

Divides this number by another given number using the specified behavior.

func raising(toPower: Int, withBehavior: NSDecimalNumberBehaviors?) -> NSDecimalNumber

Raises the number to a given power using the specified behavior.

func multiplying(byPowerOf10: Int16, withBehavior: NSDecimalNumberBehaviors?) -> NSDecimalNumber

Multiplies the number by 10 raised to the given power using the specified behavior.