A
Affan Syed
Hi,
the file that i read has the following column as input:
1.000005
1.00001
1.000015
1.00002
1.000025
Now I have float variable skew.
When i read in from the file as inFile >>skew;
I read in following values:
Skew read= 1.00001
Skew read= 1.00001
Skew read= 1.00002
Skew read= 1.00002
So it rounds up to the 5th decimal position . Why? I know it might have
something to do with the insuffereable precision of float points. But is
there some easy way of gettin to read the correct value from the file and
not go to BCD?
Similarly when i do
float x= skew-1,
I get something which is not nearly like 0.00001, but a close approximation.
Again how can i get the correct value?
Thanks
Affan
the file that i read has the following column as input:
1.000005
1.00001
1.000015
1.00002
1.000025
Now I have float variable skew.
When i read in from the file as inFile >>skew;
I read in following values:
Skew read= 1.00001
Skew read= 1.00001
Skew read= 1.00002
Skew read= 1.00002
So it rounds up to the 5th decimal position . Why? I know it might have
something to do with the insuffereable precision of float points. But is
there some easy way of gettin to read the correct value from the file and
not go to BCD?
Similarly when i do
float x= skew-1,
I get something which is not nearly like 0.00001, but a close approximation.
Again how can i get the correct value?
Thanks
Affan