Is there any way to check float/double for NaN? I can't find any.
I've checked standard C way - its not working:
if (fValue ≠ fValue)
Also I can't find any special function.
Is there any way to check float/double for NaN? I can't find any.
I've checked standard C way - its not working:
if (fValue ≠ fValue)
Also I can't find any special function.
Let the power of C++ be with you.
MrK45 said:
if (fValue ≠ fValue)
Does not work for me either anymore, since some years.
But there are related STL functions, for example:
#include <cmath>
if (!std::isfinite(fValue))
In modern C standards there is
bool std::isnan(fValue)
But I'm asking about solution for Angelscript…
Let the power of C++ be with you.
There is no built-in way for checking for NaN. But you can easiliy register a function for it.
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game