Question

I'm using C++ Builder XE and want to check a float value is valid. According to the help, in math.h, there's a call

bool IsNan(float value)

However, when I try to compile this, it tells me

Call to undefined function 'IsNan'

Looking in math.h, there's no such thing as isnan (I used a non-case sensitive search)

Am I doing something silly, or what ?

Était-ce utile?

La solution

To use the Embarcadero inbuilt IsNan() function you need to include (for XE4 anyway)

#include <System.Math.hpp>

If you are using basic XE then you need

#include <Math.hpp>

The latter also works on XE4 although the help indicates that System.Math.hpp is needed.

Autres conseils

On the forum "Embarcadero Discussion Forums » C++Builder » C++ Language" Roger Dunk wrote: std::_isnan()

This solved the error for me ...

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top