Mail Archives: djgpp/1997/03/04/22:55:20
Hello All,
Please can someone help a friend with a floating point problem
he is having whilst writing a trigonomic program which requires floating
point accuracy.. He's using DJGPP V2.1
Please don't ask WHY he wants such accuracy cos I don't know..
The problem lies below...
int main()
{
float a;
a=4.00/5.00;
printf("float = %.12f\n",a);
return(1);
}
Ans = 0.800000011921
The correct answer should be 0.800000000000 but he gets these extroneous
numbers tacked on the end???
He's using a 486/66 and I tried it on my pentium and wound up with the
same result..
Can he get 12 point accuracy and if so how??
Over to the experts.... :-)
(OH! Well, Lifes like that Sumtimes) Regards Ron T Lewis
___
X CMPQwk #1.42X UNREGISTERED EVALUATION COPY
- Raw text -