From: jerpat@iastate.edu (Jeremiah S Patterson)
Subject: Re: Which first-course languages? (was: What schools use Eiffel (was: No top schools use Ada)) ?
Date: 1995/04/21
Date: 1995-04-21T00:00:00+00:00 [thread overview]
Message-ID: <jerpat.798500036@scheme1.iastate.edu> (raw)
In-Reply-To: dewar.798388813@gnat
In <dewar.798388813@gnat> dewar@cs.nyu.edu (Robert Dewar) writes:
>"found that they were comparing floating-point numbers for equality"
>it is a common myth that this is a bad programming practice. In fact many
>numerical algorithms involve perfectly legitimate tests for equality if
>they know that they are running on reasonable floating-point hardware.
>For example, a Newton-Raphson iteration for square root will converge
>exactly on almost any reasonable fpt hardware.
>It is perhaps a safe rule for people using floating-point who don't know
>what they are doing (a common case), to avoid comparing fpt numbers for
>equality, but please let's make sure that we don't end up with idiotic
>rules that forbid this critically useful operation (IEEE fpt includes
>equality for a reason, indeed all the operations defined by 754 are
>useful, you should hestitate before declarting them useless).
>So, while I am all in favor of an undergraduate curriculum including
>discussion of underlying architectures in some considerable details
>(including interrupts, registers, caches, data representation etc.)
>I sure hope that a course in this area does not pass on the incorrect
>advice to never compare fpt for equality.
I agree to an extent...I think that stduents must be taught the
"dangers" of testing for fpt equality.
I think students need to learn that they can "control" the accuracy of
floating point numbers using multiplication and rounding then division
rather than a free-for-all, no questions asked equality check (which,
even on good systems, may blow up after a fifth or sixth operation)
That's my 2 cents worth!
Jerry
__________________________________________________________________________
Jeremiah S Patterson _/_/_/_/ \_\_\_\_
Larch 1357 Cunningham _/ _/_/_/ _/_/_/_/_/ \_ \_\_\_ \_\_\_
Ames, IA 50013 _/ _/ _/ _/ _/ _/ \_\_\_\_ \_ \_
jerpat@iastate.edu _/ _/_/_/ _/ _/ \_ \_\_\_ \_\_\_
_/_/_/_/ \_\_\_\_
jerpat@cs.iastate.edu "Where dreams are in big-O notation"
--
__________________________________________________________________________
Jeremiah S Patterson _/_/_/_/ \_\_\_\_
Larch 1357 Cunningham _/ _/_/_/ _/_/_/_/_/ \_ \_\_\_ \_\_\_
Ames, IA 50013 _/ _/ _/ _/ _/ _/ \_\_\_\_ \_ \_
jerpat@iastate.edu _/ _/_/_/ _/ _/ \_ \_\_\_ \_\_\_
_/_/_/_/ \_\_\_\_
jerpat@cs.iastate.edu "Where dreams are in big-O notation"
next prev parent reply other threads:[~1995-04-21 0:00 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <3mq0jd$r10@kaiwan009.kaiwan.com>
1995-04-19 0:00 ` No top schools use Ada Kenneth Almquist
1995-04-18 0:00 ` cjames
1995-04-19 0:00 ` Kenneth Almquist
[not found] ` <3n10sv$i97@gopher.cs.uofs.edu>
1995-04-19 0:00 ` Fernando Mato Mira
1995-04-20 0:00 ` Which first-course languages? (was: What schools use Eiffel (was: No top schools use Ada)) ? Spencer Allain
1995-04-20 0:00 ` Scott Wheeler
1995-04-21 0:00 ` Neil Wilson
[not found] ` <NEWTNews.27781.798049024.ir001168@cec-services-01>
[not found] ` <3mrg2c$onn@disunms.epfl.ch>
[not found] ` <tomkwongD76x5L.AED@netcom.com>
1995-04-19 0:00 ` Theodore Dennison
1995-04-19 0:00 ` Robert Dewar
1995-04-19 0:00 ` Theodore Dennison
1995-04-19 0:00 ` Scott Wheeler
1995-04-20 0:00 ` Robert Dewar
1995-04-21 0:00 ` Jeremiah S Patterson [this message]
1995-04-21 0:00 ` Scott Wheeler
1995-04-20 0:00 ` Robert Johnson
1995-04-20 0:00 ` Robert Dewar
1995-04-20 0:00 ` Which first-course languages? (was: What schools use Eiffel (was Geert Bosch
1995-04-21 0:00 ` Which first-course languages? (was: What schools use Eiffel (was: No top schools use Ada)) ? Des Kenny
1995-04-21 0:00 ` Robert Dewar
1995-04-20 0:00 ` What schools use Eiffel ? Igor Chudov
1995-04-21 0:00 ` Madison Cloutier
[not found] ` <D759Az.GHM@cs.fredonia.edu>
1995-04-19 0:00 ` No top schools use Ada Michael Sperber [Mr. Preprocessor]
1995-04-19 0:00 ` Ian S Nelson
1995-04-19 0:00 ` Robert Dewar
1995-04-19 0:00 ` Robert Dewar
1995-04-20 0:00 ` First Language Debate etc Deepak Kumar
1995-04-20 0:00 ` Robert Dewar
1995-04-21 0:00 ` Deepak Kumar
1995-04-20 0:00 ` No top schools use Ada Brian Hanson
1995-04-20 0:00 ` Robert Dewar
[not found] ` <NEWTNews.19974.798127420.cjames@cec-services-01>
1995-04-18 0:00 ` Jay M Martin
1995-04-20 0:00 ` Vladimir Vukicevic
1995-04-20 0:00 ` Norman H. Cohen
1995-04-20 0:00 ` cjames
1995-04-22 0:00 ` Chris Morgan
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox