Instance Method


Compares this decimal number and another.


func compare(_ decimalNumber: NSNumber) -> ComparisonResult



The number with which to compare the receiver.

This value must not be nil. If this value is nil, the behavior is undefined and may change in future versions of macOS.

Return Value

NSOrderedAscending if the value of decimalNumber is greater than the receiver; NSOrderedSame if they’re equal; and NSOrderedDescending if the value of decimalNumber is less than the receiver.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software