CFNumberCompare

Header: CFNumber.h Carbon status: Supported

Compares two CFNumber objects and returns the comparison result.

CFComparisonResult CFNumberCompare (
    CFNumberRef number, 
    CFNumberRef otherNumber, 
    void *context
);
Parameter descriptions
number

The first CFNumber object you wish to compare.

otherNumber

The second CFNumber object you wish to compare.

context

Pass NULL.

function result

Indicates whether the first CFNumber is equal to, less than, or greater than the second CFNumber. The comparison result is returned as a CFComparisonResult.

DISCUSSION

When comparing CFNumber objects, conversion and comparison follow human expectations and not C promotion and comparison rules. Negative zero compares less than positive zero. Positive infinity compares greater than everything except itself, to which it compares equal. Negative infinity compares less than everything except itself, to which it compares equal. Unlike standard practice, if both numbers are NaN, then they compare equal; if only one of the numbers is NaN, then the NaN compares greater than the other number if it is negative, and smaller than the other number if it is positive.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)