Hi guys,
I am writing some program in C. It has a part where it does some probability calculations, where I am using log function. normal library function log()...
The code is something like this
double somevalue = 0.29558101472995091;
temp = log(somevalue)
And guess what? The temp gets value -1856.0000000000000!!!
As the value given for log was inside some struct I wrote this test code too, and got the same results...
int main()
{
double somevalue;
double temp;
somevalue = 0.29558101472995091;
temp = log(somevalue);
return 0;
}
Results:
Somevalue = 0.29558101472995091
temp = -1856.0000000000000
Isn't it crazy. Anyone has some clue on whats going on here.
And I am using Visual Studio 2005 for this. Can't get my hands on someother compiler now.
Thanks,
Microkernel :)