NaN (Not a Number, not a number) is a type of value of numeric data type in computer science, which represents an undefined or unrepresentable value. Often used in floating point operations. NaN was first introduced in the IEEE 754 floating-point standard in 1985.
In floating point number operations, the concepts of NaN and infinity are different, although both are special values when representing real numbers with floating point numbers. Invalid Operation is also different from arithmetic overflow (which may return infinity) and arithmetic underflow (which may return the smallest general value, special value, zero, etc.).
There are three types of operations that return NaN:
Operations with at least one parameter being NaN
Infinitives
Real number operations that produce complex results.
For more related tutorials, please pay attention to PHP Chinese website!
The above is the detailed content of What is NaN?. For more information, please follow other related articles on the PHP Chinese website!