From mboxrd@z Thu Jan 1 00:00:00 1970 From: bakul at bitblocks.com (Bakul Shah) Date: Wed, 12 Feb 2020 15:56:20 -0800 Subject: [COFF] floating point (Re: Old and Tradition was [TUHS] V9 shell In-Reply-To: <96B92BC1-F4AF-448E-8453-E77C27E7B545@bitblocks.com> References: <20200212030152.GJ852@mcvoy.com> <9f1f6e0a-13ee-0846-e290-ec9871a3f542@technologists.com> <20200212230542.GR852@mcvoy.com> <96B92BC1-F4AF-448E-8453-E77C27E7B545@bitblocks.com> Message-ID: > On Feb 12, 2020, at 3:54 PM, Bakul Shah wrote: > > On Feb 12, 2020, at 3:05 PM, Larry McVoy wrote: >> >> On Wed, Feb 12, 2020 at 04:45:54PM -0600, Charles H Sauer wrote: >>> If I recall correctly: >>> - all doctoral candidates ended up taking two semesters of numerical >>> analysis. I still have two volume n.a. text in the attic (orange, but not >>> "burnt orange", IIRC). >>> - numerical analysis was covered on the doctoral qualifying exam. >> >> Pretty sure Madison required that stuff for Masters degrees. Or maybe >> undergrad, I feel like I took that stuff pretty early on. >> >> I'm very systems oriented so I can't imagine I would have taking that >> willingly. I hate the whole idea of floating point, just seems so >> error prone. > > David Goldberg's article "What every computer scientist should know > about floating-point arithmetic" is a good one to read: > https://www.itu.dk/~sestoft/bachelor/IEEE754_article.pdf > > I still have Bill Press's Numerical Recipes book though not opened > recently (as in not since '80s)! > > It is interesting that older languages such as Lisp & APL have a > builtin concept of tolerance. Here 0.3 < 0.1 + 0.2 is false. But > in most modern languages it is true! This is so since 0.1 + 0.2 is > 0.30000000000000004. In Fortran you'd write something like > abs(0.3 - (0.1 + 0.2)) > tolerance. You can do the same in C > etc.but for some reason it seems to be uncommon :-) Er... not right. Fl. pt. arithmetic is hard!