C++ Math isnormal()

Last Updated : 22 May 2026

Math isnormal()Function

In C++, the isnormal() function is defined in the <cmath> or <math.h> header file and is used to determine whether a floating-point value is normal or not. A normal floating-point value is neither zero, subnormal, infinite, nor NaN (Not a Number).

The isnormal() function supports float, double, long double, and integer values.

Syntax

It has the following syntax.

Parameters

x: It is a floating point value.

Return value

Parameter(x)Return value
Infinite0
Normal value1
Subnormal value0
Not a Number0

Examples of the List isnormal() Function

Here, we are going to discuss several examples to demonstrate the List isnormal() Function Function.

Example 1: Check Whether Values are Normal Using isnormal()

This example demonstrates how the isnormal() function checks normal, infinite, and NaN values.

Output:

isnormal(5) is : 1
isnormal(5.0/0.0) is : 0
isnormal(0.0/0.0) is : 0

Example 2: Check Whether Zero is a Normal Value

This example demonstrates how the isnormal() function behaves when the input value is zero.

Output:

Value of x is : 0
isnormal(x) is : 0                       

Example 3: Check Whether a Subnormal Value is Normal

This example demonstrates how the isnormal() function behaves when the input value is a subnormal floating-point value.

Output:

Value of x is : 1.11254e-308
isnormal(x) is : 0