468,504 Members | 2,003 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,504 developers. It's quick & easy.

isinf() & isnan()

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
2 49234
"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
Hi,

Thank you! it works now:)

regards,
priya

Sep 19 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Pertti Martikainen | last post: by
4 posts views Thread by siaj | last post: by
reply views Thread by Seok Bee | last post: by
3 posts views Thread by newbie1123 | last post: by
6 posts views Thread by Java script Dude | last post: by
4 posts views Thread by jacob navia | last post: by
9 posts views Thread by Richard Tobin | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.