• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: summarize to floats
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >summarize to floats (From: Jens Kohl <email@hidden>)

  • Prev by Date: summarize to floats
  • Next by Date: Runtime dylib problem
  • Previous by thread: summarize to floats
  • Next by thread: Runtime dylib problem
  • Index(es):
    • Date
    • Thread