isinf() & isnan()

Discussion in 'C++' started by Priya, Sep 19, 2006.

  1. Priya

    Priya Guest

    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
    Priya, Sep 19, 2006
    #1
    1. Advertising

  2. Priya

    P.J. Plauger Guest

    "Priya" <> wrote in message
    news:...

    > 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
    P.J. Plauger, Sep 19, 2006
    #2
    1. Advertising

  3. Priya

    Priya Guest

    Hi,

    Thank you! it works now:)

    regards,
    priya
    Priya, Sep 19, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?c2lhag==?=

    isNaN function jscript

    =?Utf-8?B?c2lhag==?=, Mar 8, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    2,767
    =?Utf-8?B?c2lhag==?=
    Mar 8, 2005
  2. Christopher Benson-Manica
    Replies:
    0
    Views:
    425
    Christopher Benson-Manica
    May 11, 2004
  3. Skybuck Flying
    Replies:
    5
    Views:
    849
  4. jacob navia

    isnan() for complex data

    jacob navia, Feb 4, 2008, in forum: C++
    Replies:
    5
    Views:
    532
    Barry
    Feb 5, 2008
  5. Richard Tobin

    isinf()

    Richard Tobin, Oct 8, 2008, in forum: C Programming
    Replies:
    8
    Views:
    625
    Martien Verbruggen
    Oct 9, 2008
Loading...

Share This Page