473,322 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

unprectable behaviour

Hi,

In my piece of code I see some unprectable behaviour for simple
functions like for example pow() function in math.h returns, -1#IND0
for simple arguments like POW( (double) 1, (double) 2 ) and
arbitrarily even some simple multiplication seem to return the same,
-1#IND0 ( in debugging mode, individual variables have correct values
but final product is undefined).

I was trying to solve this and in the process, found a wierd soltn, on
just repeating the same line again gives the correct result.

TIA

bye,
hurry.

Apr 25 '06 #1
17 2700
"hurry" <hu*********@gmail.com> wrote:
In my piece of code I see some unprectable behaviour for simple
functions like for example pow() function in math.h returns, -1#IND0
for simple arguments like POW( (double) 1, (double) 2 ) and
arbitrarily even some simple multiplication seem to return the same,
-1#IND0 ( in debugging mode, individual variables have correct values
but final product is undefined).


Wild guess... did you remember to #include <math.h>?

Richard
Apr 25 '06 #2
yup I did

Apr 25 '06 #3

hurry wrote:
Hi,

In my piece of code I see some unprectable behaviour for simple
functions like for example pow() function in math.h returns, -1#IND0
for simple arguments like POW( (double) 1, (double) 2 ) and
arbitrarily even some simple multiplication seem to return the same,
-1#IND0 ( in debugging mode, individual variables have correct values
but final product is undefined).

I was trying to solve this and in the process, found a wierd soltn, on
just repeating the same line again gives the correct result.

TIA

bye,
hurry.


Could you please post your code ?

Apr 25 '06 #4
Sorry Its a pretty huge workspace.

Is there any chance of memory related issues which could cause this ...

Apr 25 '06 #5

hurry wrote:
Sorry Its a pretty huge workspace.

Is there any chance of memory related issues which could cause this ...


Please do not use the broken Reply link present at the end of the
message. Instead goto top of the message you are replying to and click
on options to get a Reply link. Use that to post your reply so that we
can see the previous context you are replying to.

Which compiler ? Which platform ? Is "-1#IND0" the errror code / return
??

Apr 25 '06 #6

Jaspreet wrote:
hurry wrote:
Sorry Its a pretty huge workspace.

Is there any chance of memory related issues which could cause this ...


Please do not use the broken Reply link present at the end of the
message. Instead goto top of the message you are replying to and click
on options to get a Reply link. Use that to post your reply so that we
can see the previous context you are replying to.

Which compiler ? Which platform ? Is "-1#IND0" the errror code / return
??

I am working in VC++ 6.0. "-1#IND0" is the value returned from pow()
function and in the other was the result of a simple multiplication.
The code keeps running but the value becomes "-1#IND0" .

reading one of the archives of usenet I see the following comment for
"-1#IND0" ,
It is the VC++ way of outputting 'quiet Nan' or 'Indefinite'


Apr 25 '06 #7

Jaspreet wrote:
hurry wrote:
Sorry Its a pretty huge workspace.

Is there any chance of memory related issues which could cause this ...


Please do not use the broken Reply link present at the end of the
message. Instead goto top of the message you are replying to and click
on options to get a Reply link. Use that to post your reply so that we
can see the previous context you are replying to.

Which compiler ? Which platform ? Is "-1#IND0" the errror code / return
??


I am working in VC++ 6.0. "-1#IND0" is the value returned from pow()
function and in the other was the result of a simple multiplication.
The code keeps running but the value becomes "-1#IND0" .

reading one of the archives of usenet I see the following comment for
"-1#IND0" ,
"It is the VC++ way of outputting 'quiet Nan' or 'Indefinite' "

Apr 25 '06 #8

hurry wrote:
Jaspreet wrote:
hurry wrote:
Sorry Its a pretty huge workspace.

Is there any chance of memory related issues which could cause this ...


Please do not use the broken Reply link present at the end of the
message. Instead goto top of the message you are replying to and click
on options to get a Reply link. Use that to post your reply so that we
can see the previous context you are replying to.

Which compiler ? Which platform ? Is "-1#IND0" the errror code / return
??

I am working in VC++ 6.0. "-1#IND0" is the value returned from pow()
function and in the other was the result of a simple multiplication.
The code keeps running but the value becomes "-1#IND0" .

reading one of the archives of usenet I see the following comment for
"-1#IND0" ,
It is the VC++ way of outputting 'quiet Nan' or 'Indefinite'


Oh.. Could you atleast post the snippet which on execution generates a
NaN ? VC 6.0 is not regarded highly by most here and to be honest is a
broken compiler. You would be better off posting your query to a
microsoft specific newsgroup.

Apr 25 '06 #9

hurry wrote:
Jaspreet wrote:
hurry wrote:
Sorry Its a pretty huge workspace.

Is there any chance of memory related issues which could cause this ...


Please do not use the broken Reply link present at the end of the
message. Instead goto top of the message you are replying to and click
on options to get a Reply link. Use that to post your reply so that we
can see the previous context you are replying to.

Which compiler ? Which platform ? Is "-1#IND0" the errror code / return
??


I am working in VC++ 6.0. "-1#IND0" is the value returned from pow()
function and in the other was the result of a simple multiplication.
The code keeps running but the value becomes "-1#IND0" .

reading one of the archives of usenet I see the following comment for
"-1#IND0" ,
"It is the VC++ way of outputting 'quiet Nan' or 'Indefinite' "


Can you try paring down your code to a small (compilable, standard)
example that still exhibits the problem? Posting that here may enable
someone to give you a better idea, and in the process you may figure
out what's wrong anyway.

Apr 25 '06 #10
hurry wrote:
Hi,

In my piece of code I see some unprectable behaviour for simple
functions like for example pow() function in math.h returns, -1#IND0
for simple arguments like POW( (double) 1, (double) 2 ) and ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Capitalizing 'pow' is a severe error. Don't do it even for purposes of
explication. And the casts are completely unnecessary, serving only to
jar the reader of your code into thoughts that the writer of it doesn't
understand the language.
arbitrarily even some simple multiplication seem to return the same,
-1#IND0 ( in debugging mode, individual variables have correct values
but final product is undefined).


If you won't show the code that (mis)behaves in this way, there is not a
chance that anyone can see what's happening. Play nice. (Are you sure
you #included <math.h>?).

Apr 25 '06 #11

hurry wrote:
Jaspreet wrote:
hurry wrote:
Sorry Its a pretty huge workspace.

Is there any chance of memory related issues which could cause this ...
Please do not use the broken Reply link present at the end of the
message. Instead goto top of the message you are replying to and click
on options to get a Reply link. Use that to post your reply so that we
can see the previous context you are replying to.

Which compiler ? Which platform ? Is "-1#IND0" the errror code / return
??


I am working in VC++ 6.0. "-1#IND0" is the value returned from pow()
function and in the other was the result of a simple multiplication.
The code keeps running but the value becomes "-1#IND0" .

reading one of the archives of usenet I see the following comment for
"-1#IND0" , reading one of the archives of usenet I see the following comment for
"-1#IND0" ,
" It is the VC++ way of outputting 'quiet Nan' or 'Indefinite' "


Apr 25 '06 #12
Jaspreet a écrit :
Oh.. Could you atleast post the snippet which on execution generates a
NaN ? VC 6.0 is not regarded highly by most here and to be honest is a
broken compiler. You would be better off posting your query to a
microsoft specific newsgroup.


I disagree. Visual C++ has been one of the best compilers around for x86
systems, both in quality of the generated code and in the overall easy
of use. Yes, it is not perfect, but it is a good compiler.

Apr 25 '06 #13
Jaspreet wrote:
hurry wrote:
Jaspreet wrote:
hurry wrote:
Sorry Its a pretty huge workspace.

Is there any chance of memory related issues which could cause this ...
Please do not use the broken Reply link present at the end of the
message. Instead goto top of the message you are replying to and click
on options to get a Reply link. Use that to post your reply so that we
can see the previous context you are replying to.

Which compiler ? Which platform ? Is "-1#IND0" the errror code / return
??


I am working in VC++ 6.0. "-1#IND0" is the value returned from pow()
function and in the other was the result of a simple multiplication.
The code keeps running but the value becomes "-1#IND0" .

reading one of the archives of usenet I see the following comment for
"-1#IND0" ,
It is the VC++ way of outputting 'quiet Nan' or 'Indefinite'


Oh.. Could you atleast post the snippet which on execution generates a
NaN ? VC 6.0 is not regarded highly by most here and to be honest is a
broken compiler. You would be better off posting your query to a
microsoft specific newsgroup.


The problem here is almost certainly a C problem rather than a VC
problem (unless the code is actually C++) , so this group is a
reasonable place to post.

To the OP, you are probably overflowing, dividing by 0 or something
similar. Either that or corrupting memory. Try extracting the problem
code (or a subset of it) in to a small compilable test program. You
coud, for example, use the debugger to see what values variables have
just before things go wrong then write a program of the form:

#include <math.h>
#include <stdlib.h>

int main(void)
{
/* declare variables and initialise them to values the debugger gave
you */

/* maths code that shows up the problem */

/* print out the results */

return 0;
}

If this works then you know the problem is earlier, if not you have a
small complete compilable program you can post here for help.
--
Flash Gordon, living in interesting times.
Web site - http://home.flash-gordon.me.uk/
comp.lang.c posting guidelines and intro:
http://clc-wiki.net/wiki/Intro_to_clc
Apr 25 '06 #14
Jaspreet said:
VC 6.0 is not regarded highly by most here and to be honest is a
broken compiler.
I regard it very highly indeed, once you get the Service Pack that fixes
that stupid stdio glitch. Apart from that minor problem, what is it about
VC 6.0 that you think is broken, and why do you think it is not regarded
highly by most here?

You would be better off posting your query to a
microsoft specific newsgroup.


Why?

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Apr 25 '06 #15
hurry wrote:

Hi,

In my piece of code I see some unprectable behaviour for simple
functions like for example pow() function in math.h returns, -1#IND0
for simple arguments like POW( (double) 1, (double) 2 ) and
arbitrarily even some simple multiplication seem to return the same,
-1#IND0 ( in debugging mode, individual variables have correct values
but final product is undefined).

I was trying to solve this and in the process,
found a wierd soltn, on
just repeating the same line again gives the correct result.


Try to come up with a small code example
that exhibits the same problem.

--
pete
Apr 25 '06 #16
jacob navia wrote:
Jaspreet a écrit :
...VC 6.0 is not regarded highly by most here and to be honest is a
broken compiler.


I disagree. Visual C++ has been one of the best compilers around for x86
systems, both in quality of the generated code and in the overall easy
of use. Yes, it is not perfect, but it is a good compiler.


<off-topic>
VC 6.0 has been heavily criticized in C++ circles for lack of
conformance to the language standard. I do not know if this is also
applicable to C.
</off-topic>
Apr 26 '06 #17
Roberto Waltman a écrit :
jacob navia wrote:
Jaspreet a écrit :
...VC 6.0 is not regarded highly by most here and to be honest is a
broken compiler.


I disagree. Visual C++ has been one of the best compilers around for x86
systems, both in quality of the generated code and in the overall easy
of use. Yes, it is not perfect, but it is a good compiler.

<off-topic>
VC 6.0 has been heavily criticized in C++ circles for lack of
conformance to the language standard. I do not know if this is also
applicable to C.
</off-topic>


Well, of course it doesn't support the C99 C standard. Microsoft has
declared that standard not applicable ... :-)

Apr 27 '06 #18

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Joona I Palaste | last post by:
AFAIK the C standard divides behaviour of different things into four classes. 1) Defined behaviour. The implementation must do exactly what the standard says. 2) Implementation-defined behaviour....
25
by: Nitin Bhardwaj | last post by:
Well, i'm a relatively new into C( strictly speaking : well i'm a student and have been doing & studying C programming for the last 4 years).....and also a regular reader of "comp.lang.c" I...
12
by: RoSsIaCrIiLoIA | last post by:
On Mon, 07 Feb 2005 21:28:30 GMT, Keith Thompson <kst-u@mib.org> wrote: >"Romeo Colacitti" <wwromeo@gmail.com> writes: >> Chris Torek wrote: >>> In article <4205BD5C.6DC8@mindspring.com> >>>...
31
by: DeltaOne | last post by:
#include<stdio.h> typedef struct test{ int i; int j; }test; main(){ test var; var.i=10; var.j=20;
4
by: | last post by:
I have earlier used an HttpModule that did URL rewrites on the BeginRequest event. Now I am trying to use the same module in a different application on a new and upgraded machine (winxp sp2). ...
26
by: Frederick Gotham | last post by:
I have a general idea of the different kinds of behaviour described by the C Standard, such as: (1) Well-defined behaviour: int a = 2, b = 3; int c = a + b; (Jist: The code will work...
285
by: Sheth Raxit | last post by:
Machine 1 : bash-3.00$ uname -a SunOS <hostname5.10 Generic_118822-30 sun4u sparc SUNW,Sun-Fire-280R bash-3.00$ gcc -v Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/...
12
by: Franz Hose | last post by:
the following program, when compiled with gcc and '-std=c99', gcc says test.c:6: error: jump into scope of identifier with variably modified type that is, it does not even compile. ...
173
by: Ron Ford | last post by:
I'm looking for a freeware c99 compiler for windows. I had intended to use MS's Visual C++ Express and use its C capability. In the past with my MS products, I've simply needed to make .c the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.