Matthew Hannigan wrote:
Ah, but it does, look:$ python >>> "%f" % (8.0 + 0.45) '8.450000' and modifying your C program: printf("%.20f\n", res); gives 8.44999980926513671875
Thanks. I've had a chance to read the links posted and this all seems much more clearer now.
*wonders where I was when this was when this was taught in class* =P Cheers, Carlo
Also read"What Every Computer Scientist Should Know About Floating-Point Arithmetic" http://docs.sun.com/source/806-3568/ncg_goldberg.html Regards, Matt psst! The exam question will be on Theorem 14!
_______________________________________________ coders mailing list [email protected] http://lists.slug.org.au/listinfo/coders
