This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

mxIsNaN (C and Fortran)

Determine whether input is NaN (Not-a-Number)

C Syntax

#include "matrix.h"
bool mxIsNaN(double value);

Fortran Syntax

#include "fintrf.h"
integer*4 mxIsNaN(value)
real*8 value



Double-precision, floating-point number to test


Logical 1 (true) if value is NaN (Not-a-Number), and logical 0 (false) otherwise.


Call mxIsNaN to determine whether value is NaN. NaN is the IEEE® arithmetic representation for Not-a-Number. A NaN is obtained as a result of mathematically undefined operations such as

  • 0.0/0.0

  • Inf-Inf

The system understands a family of bit patterns as representing NaN. NaN is not a single value; it is a family of numbers that MATLAB® software (and other IEEE-compliant applications) uses to represent an error condition or missing data.


See the following examples in matlabroot/extern/examples/mx.

See the following examples in matlabroot/extern/examples/refbook.

Introduced before R2006a

Was this topic helpful?