By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,968 Members | 1,843 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,968 IT Pros & Developers. It's quick & easy.

isinf() & isnan()

P: n/a
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

Sep 19 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Priya" <ha*************@gmail.comwrote in message
news:11*********************@i42g2000cwa.googlegro ups.com...
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
Sep 19 '06 #2

P: n/a
Hi,

Thank you! it works now:)

regards,
priya

Sep 19 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.