Main Content

mxGetNaN (C and Fortran)

Value of NaN (Not-a-Number)

C Syntax

#include "matrix.h"
double mxGetNaN(void);

Fortran Syntax

real*8 mxGetNaN


Value of NaN (Not-a-Number) on your system


Call mxGetNaN to return the value of NaN for your system. NaN is the IEEE® arithmetic representation for Not-a-Number. Certain mathematical operations return NaN as a result, for example,

  • 0.0/0.0

  • Inf-Inf

Your system specifies the value of Not-a-Number. You cannot modify it.

C Examples

See these examples in matlabroot/extern/examples/mx:

Version History

Introduced before R2006a