## You are here

Homenot a number

## Primary tabs

# not a number

In a computer, not a number (usually abbreviated NaN) indicates that an arithmetical operation has resulted in a value that is not a number understood (or representable) by the computer. Division by zero is one frequent cause of a result being NaN. Asking for the square root of a negative number is another operation that can result in NaN (unless the computer has been programmed to recognize imaginary numbers).

NaN is not a specific value that can be tested for with the usual comparison operators. The programmer is advised to test for NaN with a special function provided by the programming language (such as `isNaN(x)`

in JavaScript.

Generally, computer algebra systems do not report NaN results even if they do display an error message for a given operation.

# References

- 1 David Flanagan, JavaScript the Definitive Guide: The Definitive Guide. New York: O’Reilly (2006): 24

## Mathematics Subject Classification

68P01*no label found*

- Forums
- Planetary Bugs
- HS/Secondary
- University/Tertiary
- Graduate/Advanced
- Industry/Practice
- Research Topics
- LaTeX help
- Math Comptetitions
- Math History
- Math Humor
- PlanetMath Comments
- PlanetMath System Updates and News
- PlanetMath help
- PlanetMath.ORG
- Strategic Communications Development
- The Math Pub
- Testing messages (ignore)

- Other useful stuff
- Corrections