fpclassify() — Classifies an argument value

Standards

Standards / Extensions C or C++ Dependencies

 C99
Single UNIX Specification, Version 3
C/C++ DFP
C++ TR1 C99

both

z/OS V1R8

Format

#define _ISOC99_SOURCE
#include <math.h>

int fpclassify (real-floating x);

#define __STDC_WANT_DEC_FP__
#include <math.h> 

int fpclassify([real-floating|decimal-floating] x);

#define _TR1_C99
#include <math.h>

int fpclassify(real-floating x);

General description

This macro or function template classifies its argument value as NaN, infinite, normal, subnormal or zero based on the type of its argument. If the argument is represented in a format wider than its semantic type, then it is converted to its semantic type and then it is classified.

Function Hex IEEE
fpclassify X X
Notes:
  1. To use IEEE decimal floating-point, the hardware must have the Decimal Floating-Point Facility installed.
  2. This function works in IEEE decimal floating-point format. See "IEEE Decimal Floating-Point" for more information.

Returned value

fpclassify() returns:

Special behavior in hex:
  • FP_ZERO if the argument is of value zero.
  • FP_NORMAL if the argument is a normalized number.
  • FP_SUBNORMAL if the argument is an unnormalized number.

Related information