code not true?
Michael Hudson
mwh21 at cam.ac.uk
Mon Apr 24 15:51:18 EDT 2000
"Mark Hammond" <mhammond at skippinet.com.au> writes:
> "Grant Edwards" <nobody at nowhere.nohow> wrote in message
> news:M3iM4.518$wJ1.17829 at ptah.visi.com...
>
> > This seems to be something that we were all told as freshmen
> > but stumble over later anyway. One wonders if a safe language
> > intended for use by beginners should even have an equality
> > operator for floating point objects.
>
> Of all the solutions to this problem, this does strike me as one of the
> best - simply remove equality testing al together for floating point:
>
This is what the latest revision of ML actually does; it doesn't put
real in the "Eq" typeclass (or whatever the ML terminology is).
It's a bit of a broad brush solution, but a reasonable one, IMHO, for
ML. I don't think Python could get away with it. Similar to the int
division problem (I'd be quite happy if that blew up).
M.
--
58. Fools ignore complexity. Pragmatists suffer it. Some can avoid
it. Geniuses remove it.
-- Alan Perlis, http://www.cs.yale.edu/~perlis-alan/quotes.html
More information about the Python-list
mailing list