Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ fpclassifyf(3M) — HP-UX 10.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

finite(3M)

isinf(3M)

isnan(3M)

fpclassify(3M)

NAME

fpclassify(), fpclassifyf() − floating-point operand classification functions

SYNOPSIS

#include <math.h>

int fpclassify(double x);

int fpclassifyf(float x);

DESCRIPTION

fpclassify() and fpclassifyf() return a non-negative integer value that specifies the IEEE operand class to which the argument x belongs.  The value returned is one of the following macros, which are defined in <math.h>:

#define FP_PLUS_NORM      0  /* Positive normalized */
#define FP_MINUS_NORM     1  /* Negative normalized */
#define FP_PLUS_ZERO      2  /* Positive zero */
#define FP_MINUS_ZERO     3  /* Negative zero */
#define FP_PLUS_INF       4  /* Positive infinity */
#define FP_MINUS_INF      5  /* Negative infinity */
#define FP_PLUS_DENORM    6  /* Positive denormalized */
#define FP_MINUS_DENORM   7  /* Negative denormalized */
#define FP_SNAN           8  /* Signalling NaN */
#define FP_QNAN           9  /* Quiet NaN */

Every possible argument value falls into one of these ten categories, so these functions never result in an error. 

fpclassifyf() is a float version of fpclassify(); it takes a float argument.  To use this function, compile either with the −Ae option or with the −Aa and −D_HPUX_SOURCE options.  Otherwise, the compiler promotes the float argument to double, and the function returns incorrect results. 

These functions are not specified by any standard.  However, they implement the class() function suggested in the "Recommended Functions and Predicates" appendix of the IEEE-754 floating-point standard.  Also, fpclassifyf() is named in accordance with the conventions specified in the "Future Library Directions" section of the ANSI C standard. 

To use these functions, link in the math library by specifying −lm on the compiler or linker command line. 

ERRORS

No errors are defined. 

SEE ALSO

finite(3M), isinf(3M), isnan(3M). 

Hewlett-Packard Company  —  HP-UX Release 10.20:  July 1996

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026