floating vs. double
- From: "Robert Wong" <robertwong@xxxxxxxxxxx>
- Date: Tue, 19 Dec 2006 16:15:30 -0500
Hi there,
I was wondering if someone can explain this? There seems to be a big
difference in the computation which the resultant is float vs. double. I'm
not sure if I understand it myself.
Is this a compiler problem? or just a precision loss?
Robert
---- simple C/C++ cold
#include <stdio.h>
#include <stdlib.h>
void main(void)
{
long int value = 1028827861;
float lsb = 0.0009765625;
float answer;
double danswer;
answer = value * lsb;
danswer = value * lsb;
printf("\nFloat value Answer = %6.3f",answer);
printf("\nDouble value Answer = %6.3f",danswer);
}
.
- Prev by Date: Re: Stupid Question - Where is Copy Project in VS.Net 2005
- Next by Date: How To ? 4 Visual Basic
- Previous by thread: help rqd with Quantify within Visual Studio
- Next by thread: How To ? 4 Visual Basic
- Index(es):
Relevant Pages
|