Nigel Stevens
Nigel Stevens

Reputation: 147

Why can't I compile IsNan in C++ Builder

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 ?

Upvotes: 1

Views: 1520

Answers (2)

Dobedani
Dobedani

Reputation: 578

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

This solved the error for me ...

Upvotes: 0

mathematician1975
mathematician1975

Reputation: 21351

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.

Upvotes: 5

Related Questions