Functions
The following functions are available globally.
-
Returns the result of adding
left
toright
.Declaration
Swift
public func + (left: NSDecimalNumber, right: NSDecimalNumber) -> NSDecimalNumber
Parameters
left
The left operand
right
The right operand
Return Value
The result
-
Adds
left
toright
and assigns the result toleft
.Declaration
Swift
public func += (left: inout NSDecimalNumber, right: NSDecimalNumber)
Parameters
left
The left operand
right
The right operand
-
Returns the result of subtracting
right
fromright
.Declaration
Swift
public func - (left: NSDecimalNumber, right: NSDecimalNumber) -> NSDecimalNumber
Parameters
left
The left operand
right
The right operand
Return Value
The result
-
Subtracts
right
fromleft
and assigns the result toleft
.Declaration
Swift
public func -= (left: inout NSDecimalNumber, right: NSDecimalNumber)
Parameters
left
The left operand
right
The right operand
-
Returns the result of multiplying
left
byright
.Declaration
Swift
public func * (left: NSDecimalNumber, right: NSDecimalNumber) -> NSDecimalNumber
Parameters
left
The left operand
right
The right operand
Return Value
The result
-
Multiplies
left
byright
and assigns the result toleft
.Declaration
Swift
public func *= (left: inout NSDecimalNumber, right: NSDecimalNumber)
Parameters
left
The left operand
right
The right operand
-
Returns the result of dividing
left
byright
.Declaration
Swift
public func / (left: NSDecimalNumber, right: NSDecimalNumber) -> NSDecimalNumber
Parameters
left
The left operand
right
The right operand
Return Value
The result
-
Divides
left
byright
and assigns the result toleft
.Declaration
Swift
public func /= (left: inout NSDecimalNumber, right: NSDecimalNumber)
Parameters
left
The left operand
right
The right operand
-
Returns the minimum value of
left
andright
.Declaration
Swift
public func min(_ left: NSDecimalNumber, _ right: NSDecimalNumber) -> NSDecimalNumber
Parameters
left
The left operand
right
The right operand
Return Value
left
ifleft
is less thanright
, otherwiseright
-
Returns the maximum value of
left
andright
.Declaration
Swift
public func max(_ left: NSDecimalNumber, _ right: NSDecimalNumber) -> NSDecimalNumber
Parameters
left
The left operand
right
The right operand
Return Value
left
ifleft
is greater thanright
, otherwiseright
-
Invokes the provided
block
and returns the result.let retval = run { // do stuff and return a value }
Declaration
Swift
@inlinable @inline(__always) public func run<T>(_ block: () -> T) -> T
Parameters
block
The block to invoke
Return Value
The result of invoking
block