473,503 Members | 3,739 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

strange output

mp
When printing a floating math result I sometimes get the following:

-1.#IND00

Can anyone tell what this means and how to avoid it?

Thank you,

Mar 9 '06 #1
4 4156
mp wrote:
When printing a floating math result I sometimes get the following:

-1.#IND00

Can anyone tell what this means and how to avoid it?

Thank you,

It doesn't mean anything to me. Can you give us more detail, some code
perhaps.

--
Joe Wright
"Everything should be made as simple as possible, but not simpler."
--- Albert Einstein ---
Mar 9 '06 #2
On 2006-03-09, mp <mp****@wisc.edu> wrote:
When printing a floating math result I sometimes get the following:

-1.#IND00

Can anyone tell what this means and how to avoid it?

Thank you,


<wild speculation>
Negative infinity?
Mar 9 '06 #3
mp
I am new to C.
This function is used to calculate a basic F-statistic.
Most of the time it works fine, once in a while it will fail with
several values
set to -1.#IND00.

double calcF(int *marker, int *groups, double *groupmean, double
*pheno, int numStrains, int Largest, double totalmean)
{
int gpctr = 0; // group iterator
/******************** Count number in each group
***************************/
int m = 0;
int tmp = 0;
for(gpctr = 1; gpctr<=Largest; gpctr++)
{ tmp = 0;
for(m=0;m<numStrains;m++)
{
if( gpctr == marker[m] )
{
tmp++;
}

}

}

/***************** Calc mean for each group ***********************/
double tmpsum = 0.0;
for(gpctr = 1; gpctr<=Largest; gpctr++)
{
tmpsum = 0.0;
for(m=0;m<numStrains;m++)
{
if( gpctr == marker[m])
{
tmpsum += pheno[m];
}
groupmean[gpctr] = (tmpsum/groups[gpctr]);

}

}
/************************************************** ***************/

double sstot = 0.0; //sum of squares total
double ssbet = 0.0; //sum of squares between
double ssw = 0.0; //sum of squares within
double dfbet = 0.0; // degrees of freedom between
double dfw = 0.0; // degrees of freedom within
double f = 0.0; // F-statistic

/******** CALC sum of square total *********/
double sstmp = 0.0;
for(m=0;m<numStrains;m++)
{
sstmp += ((pheno[m] - totalmean) * (pheno[m] - totalmean) );

}
sstot = sstmp;

/******** CALC sum of square between *********/
sstmp = 0.0;

for(gpctr = 1; gpctr<=Largest; gpctr++)
{
sstmp += ((groupmean[gpctr] - totalmean) *
(groupmean[gpctr] - totalmean));
}
ssbet = sstmp; //########## THIS SOMETIMES SET TO -1.#IND00
/******** CALC sum of square within *********/

if( ssbet == 0)
{
ssw = sstot;
}else{
ssw = sstot - ssbet;
}
/******** CALC degrees of freedom *********/

dfbet = (Largest - 1);
dfw = (numStrains - Largest);
/******** Calc F-statistic ************************/
if(ssw == 0 || dfbet == 0 || dfw == 0 || ssbet == 0)
{
return f = 1000.1;
}else{

f = (ssbet/dfbet)/(ssw/dfw);

return f;
}

Mar 9 '06 #4
mp wrote:
When printing a floating math result I sometimes get the following:

-1.#IND00

Can anyone tell what this means and how to avoid it?

Thank you,


Don't know, but I get 99,300 hits for #IND00 from Google.

--
==============
*Not a pedant*
==============
Mar 9 '06 #5

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

Similar topics

2
2145
by: Claudio | last post by:
hi all i put in this email source code so u can copy and paste to verify strange first : in this example bit size is a BYTE ?! second : in the last printf output is wrong ? ? best...
24
4711
by: LineVoltageHalogen | last post by:
Greetings All, I was hoping that someone out there has run into this issue before and can shed some light on it for me. I have a stored procedure that essentially does a mini ETL from a source...
8
1814
by: grundmann | last post by:
Hello, i got a strange compiler error. When compiling the following: // forward declarations typedef AvlTree<LineSegment,LineSegmentComperator> LSTree; void handleEventPoint (const...
8
2040
by: Victor Lamberty | last post by:
Greetings C coders I am new to the world of C and have been trying to compile this program. I got the result that I wanted but outputed it in a strange way it put it before the prompt is there a...
6
8501
by: leonecla | last post by:
Hi everybody, I'm facing a very very strange problem with a very very simple C program... My goal should be to write to a binary file some numbers (integers), each one represented as a sequence...
1
1431
by: Martin Feuersteiner | last post by:
Dear Group I'm having a very weird problem. Any hints are greatly appreciated. I'm returning two values from a MS SQL Server 2000 stored procedure to my Webapplication and store them in...
5
4049
by: soeren | last post by:
Hello, two days ago I stumbled across a very strange problem that came up when we were printing tiny double numbers as strings and trying to read them on another place. This is part of an object...
5
3098
by: Ian | last post by:
Hi everyone, I have found some bizarre (to me...!) behaviour of the Form_Activate function. I have a form which has a button control used to close the form and a subform with a datasheet view...
4
1378
by: stat_holyday | last post by:
Greetings. I'm confused. I'm attemting to create dynamic buttons based on the count of questions in a database. The button has 3 states, blank, selected, and inactive. The script below works great,...
2
1576
by: danep2 | last post by:
Hello all This is a really strange problem. I have code that performs a few calculations based on input from a joystick, and writes these values to a file using basically the following code: ...
0
7192
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,...
0
7261
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,...
0
7315
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6974
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5559
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4665
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...
0
3158
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...
0
3147
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.