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 7 - Numeric Data Types in C


Inquiries: Class and Sign

MathLib provides macros you can use to determine the class and sign of a floating-point value. All of these macros return type long int. They are listed in Table 7-3.
Table 7-3 Class and sign inquiry macros
MacroValue returnedCondition
fpclassify(x)FP_SNANx is a signaling NaN
 FP_QNANx is a quiet NaN
 FP_INFINITEx is - or +
 FP_ZEROx is +0 or -0
 FP_NORMALx is a normalized number
 FP_SUBNORMALx is a denormalized (subnormal) number
isnormal(x)TRUE x is a normalized number
isfinite(x)TRUE x is not - , + , or NaN
isnan(x)TRUE x is a NaN (quiet or signaling)
signbit(x)1The sign bit of x is 1 (x is negative)
 0The sign bit of x is 0 (x is positive)


Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 JUL 1996