eCharcha.Com   Support eCharcha.Com. Click on sponsor ad to shop online!

Advertise Here

Go Back   eCharcha.Com > Science and Technology > Computing

Notices

Computing All things binary...

Reply
 
Thread Tools Display Modes
  #1  
Old February 7th, 2008, 12:03 PM
JaiSpeaks's Avatar
JaiSpeaks JaiSpeaks is offline
The NEo of Echarcha
 
Join Date: Apr 2001
Location: USA
Posts: 6,830
JaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond repute
The stupid -1.#IND

To all C++ Gurus

How can I catch a variable having this value -1.#IND in VC++.

Mera dimag nahi chal raha
__________________
If you win you need not explain.. But if you lose you should not be there to explain
Reply With Quote
  #2  
Old February 7th, 2008, 12:25 PM
2gud's Avatar
2gud 2gud is offline
We change, values don't
 
Join Date: Nov 2003
Posts: 4,040
2gud has a reputation beyond repute2gud has a reputation beyond repute2gud has a reputation beyond repute2gud has a reputation beyond repute2gud has a reputation beyond repute2gud has a reputation beyond repute2gud has a reputation beyond repute2gud has a reputation beyond repute2gud has a reputation beyond repute2gud has a reputation beyond repute2gud has a reputation beyond repute
Re: The stupid -1.#IND

-1.#IND is the VC compilers way of telling you that it encountered a situation where a NaN or a non real number resulted from some calculation... something like ln[-1], acos[100], sqrt[-1], which do not result in a real number...

It is different from -1.#INF which results because of arbitrarily large numbers or div by zero... isinf() can handle the div by zero exception.. I guess, isnan() may allow you to hand -1.#IND as it is nothing but a NaN...
__________________
If you're doing business with a religious son-of-a-bitch, get it in writing. His word isn't worth shit. Not with the good lord telling him how to fuck you on the deal. - William Burroughs
Reply With Quote
  #3  
Old February 7th, 2008, 12:54 PM
Sane Less's Avatar
Sane Less Sane Less is offline
Dead On Arrival is back
 
Join Date: Jun 2005
Posts: 17,351
Sane Less has a reputation beyond reputeSane Less has a reputation beyond reputeSane Less has a reputation beyond reputeSane Less has a reputation beyond reputeSane Less has a reputation beyond reputeSane Less has a reputation beyond reputeSane Less has a reputation beyond reputeSane Less has a reputation beyond reputeSane Less has a reputation beyond reputeSane Less has a reputation beyond reputeSane Less has a reputation beyond repute
Re: The stupid -1.#IND

For a moment there I thought you were saying stupid number 1 Indians
__________________
-----------------------------------------------

"Hinduism brought a multitude of religions under one roof and survived for eons. Christianity and other religions will need to do the same or perish." - saneless
Reply With Quote
  #4  
Old February 7th, 2008, 12:55 PM
pakkidost's Avatar
pakkidost pakkidost is offline
Senior eCharchan
 
Join Date: May 2003
Location: Hum banjaron ki baat mat poocho ji.
Posts: 2,870
pakkidost has a reputation beyond reputepakkidost has a reputation beyond reputepakkidost has a reputation beyond reputepakkidost has a reputation beyond reputepakkidost has a reputation beyond reputepakkidost has a reputation beyond reputepakkidost has a reputation beyond reputepakkidost has a reputation beyond reputepakkidost has a reputation beyond reputepakkidost has a reputation beyond reputepakkidost has a reputation beyond repute
Re: The stupid -1.#IND

Quote:
Originally Posted by Sane Less
For a moment there I thought you were saying stupid number 1 Indians

Me Too
__________________


Loud and Proud LLKC member since infinity and beyond

Loud but not so Proud IDLE
Reply With Quote
  #5  
Old February 7th, 2008, 01:08 PM
love_to_surf's Avatar
love_to_surf love_to_surf is offline
Senior eCharchan
 
Join Date: May 2005
Posts: 1,551
love_to_surf has much to be proud oflove_to_surf has much to be proud oflove_to_surf has much to be proud oflove_to_surf has much to be proud oflove_to_surf has much to be proud oflove_to_surf has much to be proud oflove_to_surf has much to be proud oflove_to_surf has much to be proud oflove_to_surf has much to be proud oflove_to_surf has much to be proud of
Re: The stupid -1.#IND

Quote:
Originally Posted by pakkidost
Me Too

I thought - "The Most Stupid ID ".
Reply With Quote
  #6  
Old February 7th, 2008, 01:17 PM
JaiSpeaks's Avatar
JaiSpeaks JaiSpeaks is offline
The NEo of Echarcha
 
Join Date: Apr 2001
Location: USA
Posts: 6,830
JaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond repute
Re: The stupid -1.#IND

Quote:
Originally Posted by 2gud
-1.#IND is the VC compilers way of telling you that it encountered a situation where a NaN or a non real number resulted from some calculation... something like ln[-1], acos[100], sqrt[-1], which do not result in a real number...

It is different from -1.#INF which results because of arbitrarily large numbers or div by zero... isinf() can handle the div by zero exception.. I guess, isnan() may allow you to hand -1.#IND as it is nothing but a NaN...

there is no isnan() defined . u know wat to include
__________________
If you win you need not explain.. But if you lose you should not be there to explain
Reply With Quote
  #7  
Old February 7th, 2008, 01:18 PM
JaiSpeaks's Avatar
JaiSpeaks JaiSpeaks is offline
The NEo of Echarcha
 
Join Date: Apr 2001
Location: USA
Posts: 6,830
JaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond repute
Re: The stupid -1.#IND

Quote:
Originally Posted by Sane Less
For a moment there I thought you were saying stupid number 1 Indians
kaiko saneful pai . MNS aur SP dono aake marenge .
__________________
If you win you need not explain.. But if you lose you should not be there to explain
Reply With Quote
  #8  
Old February 7th, 2008, 01:21 PM
2gud's Avatar
2gud 2gud is offline
We change, values don't
 
Join Date: Nov 2003
Posts: 4,040
2gud has a reputation beyond repute2gud has a reputation beyond repute2gud has a reputation beyond repute2gud has a reputation beyond repute2gud has a reputation beyond repute2gud has a reputation beyond repute2gud has a reputation beyond repute2gud has a reputation beyond repute2gud has a reputation beyond repute2gud has a reputation beyond repute2gud has a reputation beyond repute
Re: The stupid -1.#IND

Quote:
Originally Posted by JaiSpeaks
there is no isnan() defined . u know wat to include
fucking VC++ compiler I was using mostly gcc when I did some compiling way back.. isnan() is a UNIX C function... equivalent would be in _isnan() in float.h... never tried it though...
__________________
If you're doing business with a religious son-of-a-bitch, get it in writing. His word isn't worth shit. Not with the good lord telling him how to fuck you on the deal. - William Burroughs
Reply With Quote
  #9  
Old February 7th, 2008, 01:39 PM
2gud's Avatar
2gud 2gud is offline
We change, values don't
 
Join Date: Nov 2003
Posts: 4,040
2gud has a reputation beyond repute2gud has a reputation beyond repute2gud has a reputation beyond repute2gud has a reputation beyond repute2gud has a reputation beyond repute2gud has a reputation beyond repute2gud has a reputation beyond repute2gud has a reputation beyond repute2gud has a reputation beyond repute2gud has a reputation beyond repute2gud has a reputation beyond repute
Re: The stupid -1.#IND

also refer this from MS documentation...

http://msdn2.microsoft.com/en-us/lib...ble.isnan.aspx

Visual C++

// This will return true.
if ( Double::IsNaN( 0 / zero ) )
{
Console::WriteLine( "Double::IsNan() can determine whether a value is not-a-number." );
}
__________________
If you're doing business with a religious son-of-a-bitch, get it in writing. His word isn't worth shit. Not with the good lord telling him how to fuck you on the deal. - William Burroughs
Reply With Quote
  #10  
Old February 7th, 2008, 02:03 PM
JaiSpeaks's Avatar
JaiSpeaks JaiSpeaks is offline
The NEo of Echarcha
 
Join Date: Apr 2001
Location: USA
Posts: 6,830
JaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond repute
Re: The stupid -1.#IND

2gud pai , woh bhi try kara tha lekin hua nahi .

but i got finally googled a forum which helped solve it

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

He says something abt VC++ not being C99 complaint . and ofcourse "fucking VC++ compiler"
__________________
If you win you need not explain.. But if you lose you should not be there to explain
Reply With Quote
  #11  
Old February 7th, 2008, 03:46 PM
landyaBhai's Avatar
landyaBhai landyaBhai is offline
Proud LLKC member
 
Join Date: Apr 2004
Location: Here-Now
Posts: 6,422
landyaBhai has a reputation beyond reputelandyaBhai has a reputation beyond reputelandyaBhai has a reputation beyond reputelandyaBhai has a reputation beyond reputelandyaBhai has a reputation beyond reputelandyaBhai has a reputation beyond reputelandyaBhai has a reputation beyond reputelandyaBhai has a reputation beyond reputelandyaBhai has a reputation beyond reputelandyaBhai has a reputation beyond reputelandyaBhai has a reputation beyond repute
Re: The stupid -1.#IND

Quote:
Originally Posted by JaiSpeaks
2gud pai , woh bhi try kara tha lekin hua nahi .

but i got finally googled a forum which helped solve it

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

He says something abt VC++ not being C99 complaint . and ofcourse "fucking VC++ compiler"
__________________
The Quieter You Become, The More You Can Hear
Reply With Quote
  #12  
Old February 7th, 2008, 10:58 PM
Gr8_Hindustani's Avatar
Gr8_Hindustani Gr8_Hindustani is offline
Senior eCharchan
 
Join Date: Apr 2001
Posts: 1,891
Gr8_Hindustani has a reputation beyond reputeGr8_Hindustani has a reputation beyond reputeGr8_Hindustani has a reputation beyond reputeGr8_Hindustani has a reputation beyond reputeGr8_Hindustani has a reputation beyond reputeGr8_Hindustani has a reputation beyond reputeGr8_Hindustani has a reputation beyond reputeGr8_Hindustani has a reputation beyond reputeGr8_Hindustani has a reputation beyond reputeGr8_Hindustani has a reputation beyond reputeGr8_Hindustani has a reputation beyond repute
Re: The stupid -1.#IND

[quote=JaiSpeaks

Mera dimag nahi chal raha[/QUOTE]

They why ask? Just chill out
__________________
HINDUSTANI

Ek he ulloo kafi hai barbade gulistan kee liya,
Anjamye gulistan kya hoga jab har daal pee ulloo bethe hoon
Reply With Quote
  #13  
Old February 7th, 2008, 11:03 PM
JaiSpeaks's Avatar
JaiSpeaks JaiSpeaks is offline
The NEo of Echarcha
 
Join Date: Apr 2001
Location: USA
Posts: 6,830
JaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond reputeJaiSpeaks has a reputation beyond repute
Re: The stupid -1.#IND

haan re . rum peeke coding kar raha hoon .

variables ke naam bhi brands ke hisab se hai
__________________
If you win you need not explain.. But if you lose you should not be there to explain
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Age of stupid .. or do they think we are stupid? smellyfinger SoapBox 6 October 1st, 2009 09:57 AM
How stupid can people be? Zorro Economy 1 June 23rd, 2009 08:40 AM
Stupid polls Netra SoapBox 6 January 9th, 2003 12:26 PM
Are people really that stupid ? dirty Taaza Khabar - Current news 5 August 23rd, 2002 07:05 PM
why are the motorists so stupid! loverboy260 SoapBox 21 August 3rd, 2002 04:39 PM


All times are GMT -7. The time now is 01:41 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Site Copyright © eCharcha.Com 2000-2012.