isinf() & isnan()

P

Priya

Halo.

I am using isinf() & isnan() in my code, and i get an error

error LNK2001: unresolved external symbol "int __cdecl isnan(double)"
(?isnan@@YAHN@Z)

my code is the implementation of LambertW function

#include <math.h>
#include <cmath>
#include <stdio.h>
#include <iostream>
using namespace std;

double LambertW(const double z) {

.....
....
...
if (z<-em1 || isinf(z) || isnan(z)) {
fprintf(stderr,"LambertW: bad argument %g, exiting.\n",z); exit(1);

}

...
...
}

Could anyone let me know, how to resolve this??

I am working on Visual C++ 2005 Express edition

Thank you,
priya
 
P

P.J. Plauger

I am using isinf() & isnan() in my code, and i get an error

error LNK2001: unresolved external symbol "int __cdecl isnan(double)"
(?isnan@@YAHN@Z)

my code is the implementation of LambertW function

#include <math.h>
#include <cmath>
#include <stdio.h>
#include <iostream>
using namespace std;

double LambertW(const double z) {

....
...
..
if (z<-em1 || isinf(z) || isnan(z)) {
fprintf(stderr,"LambertW: bad argument %g, exiting.\n",z); exit(1);

}

..
..
}

Could anyone let me know, how to resolve this??

I am working on Visual C++ 2005 Express edition

VC++ is nowhere near C99 compliant yet, and you're trying to use
C99 functions. Unless the compiler subverts your efforts, you can
usually define isnan as:

#define isnan(x) ((x) != (x))

HTH,

P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top