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 ?

有帮助吗?

解决方案

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.

其他提示

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

This solved the error for me ...

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top