473,385 Members | 1,872 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,385 software developers and data experts.

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 4150
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
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
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
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
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
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
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
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
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
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
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
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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...

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.