isnormal() — Determines if X is normal

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 isnormal(real-floating x);

#define __STDC_WANT_DEC_FP__
#include <math.h>

int isnormal(real-floating x);  /* C only */
int isnormal(decimal-floating x);  /* C only */
bool isnormal(real-floating x);  /* C++ only */
bool isnormal(decimal-floating x);  /* C++ only */

#define _TR1_C99
#include <math.h>

bool isnormal(real-floating x);  /* C++ only */

General description

The isnormal() macro or function template determines if its argument value is normal, that is, not zero, infinity, subnormal or a NaN.

Function Hex IEEE
isnormal 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

The isnormal() macro returns 1 if the argument value is normal, else returns 0. The C++ template returns true if the argument value is normal, else returns false.

Special behavior in Hex: For normalized numbers, isnormal() returns one. For zero or an unnormalized number, isnormal() returns zero. The C++ function template for normalized numbers, isnormal() returns true. For zero or a number that is not normalized, isnormal() returns false.

Related information