Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: PowerPC Numerics / Part 2 - The PowerPC Numerics C Implementation
Chapter 10 - Transcendental Functions


Comparison Functions

MathLib provides four functions that perform comparisons between two floating-point arguments:
fdim(x,y) Returns the positive difference x - y or 0.
fmax(x,y) Returns the maximum of x or y.
fmin(x,y) Returns the minimum of x or y.
relation(x,y) Returns the relationship between x and y.

These functions take advantage of the rule from the IEEE standard that all values except NaNs have an order:

- < all negative real numbers < -0 = +0 < all positive real numbers < +

These functions also make special cases of NaNs so that they raise no floating-point exceptions.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 JUL 1996