Re: summarize to floats
Re: summarize to floats
- Subject: Re: summarize to floats
- From: Glenn Andreas <email@hidden>
- Date: Sat, 23 Aug 2003 20:17:48 -0500
I'm learning cocoa at the moment. So I wrote a small application
which reads two textfields into to floats. Than float1 + float2 and
write it to a third textfield. Nothing wrong with that works. But I
realize a strange behaviour:
0.5 + 0.5 = 1
0.6 + 0.6 = 1.1929xxxx // or something like that; should be 1.2 in my opinion.
Can somebody explain that?
"What Every Computer Scientist Should Know About Floating Point Arithmetic":
http://docs-pdf.sun.com/800-7895/800-7895.pdf
or
http://docs.sun.com/db/doc/800-7895
for the (uglier) non-PDF version.
Glenn Andreas email@hidden
Author of Macintosh games: Theldrow 2.3, Blobbo 1.0.2, Cythera 1.0.2
Be good, and you will be lonesome
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.