473,799 Members | 2,985 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 49866
"Priya" <ha************ *@gmail.comwrot e in message
news:11******** *************@i 42g2000cwa.goog legroups.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
15642
by: Skybuck Flying | last post by:
Hi, I have one more remaining "problem" with compiling a unix source code for windows/visual c/c++ 6.0 What does the isnan routine do ? Documentation says it checks for NaN ? What does that mean ? What is a good replacement for Visual C/C++ 6.0 ?
4
9683
by: Pertti Martikainen | last post by:
Hi, The following lines are from my Immediate - window: dValue NaN Double.IsNaN(dValue) false I evaluate variable dValue, I get NaN but IsNaN returns
4
4552
by: siaj | last post by:
I am new to jscript.. I am trying to validate if a textbox on my ASP.NET page has numeric value.. The code I am using is function IsValidAmount() { var intTotalAmt = document.Form1.txtTotalAmt.value; If (isNaN(intAmt1)== false) {//do something} }
0
1549
by: Seok Bee | last post by:
Dear Experts, I am having a wizard control in my web app. I have some textbox controls within the wizard control. At the same time, I have a hyperlink to run a pop-up window for calendar. The pop-up window is executed by calling a javascript function. However, when I click on the calendar link for the pop-up, I received an error message stating : Microsoft JScript runtime error: Object required When I use the same script in another...
3
3348
by: newbie1123 | last post by:
Hi! I am using Borland c++ builder version 6.0 and when I compile a program containing isinf() (I did include math.h) I get 'call to undefined function isinf'. Anyone knows what is wrong? Thanks
6
5588
by: Java script Dude | last post by:
Small glitch (IMHO) in JavaScript is related to isNaN() boolean function. If passed a null, it returns true which is incorrect. This one cause me quite a bit of grief until I detected it and was able to code around it. Anybody know the reasoning for the result being false and not true for isNaN(null). - JsD
4
4294
by: jacob navia | last post by:
Hi Has C++ defined the function isnan() for complex numbers? What is the definition? Thanks in advance -- jacob navia jacob at jacob point remcomp point fr
9
6884
by: Richard Tobin | last post by:
The GNU Autoconf manual provides a work-around for missing isinf() and isnan() functions, which exist in C99 and many, but not all, pre-C99 implementations: http://www.gnu.org/software/libtool/manual/autoconf/Function-Portability.html The given definition of isinf(x) boils down to return isnan (x - x), which will return true for NaNs. Surely this is wrong? -- Richard
0
9686
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9540
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10475
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10026
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7564
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4139
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.