[Info-vax] Floating Point (was Re: DCL's flaws (both scripting and UI))

Simon Clubley clubley at remove_me.eisner.decus.org-Earth.UFP
Sat Jan 31 11:30:20 EST 2015


On 2015-01-31, Stephen Hoffman <seaohveh at hoffmanlabs.invalid> wrote:
> On 2015-01-31 15:49:01 +0000, Simon Clubley said:
>
>> 
>> If I had my way, all languages would either outright ban equality testing
>> of two floating point numbers or would require the programmer to state at
>> some point within the source code what the acceptable delta is between two
>> floating point numbers before they are no longer considered to be equal.
>
> For those that have not seen and have not bookmarked it already,
> Goldberg's What Every Computer Scientist Should Know About 
> Floating-Point Arithmetic
><http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html>
>

Interesting reading. As regards the error bound comment in that paper
when it comes it testing for equality, the reason why I mentioned
requiring the programmer to state the delta in the source code is to
make them aware of the issue and to allow them to choose an application
specific acceptable value.

Of course, what is depressing is that there appears to be a good number
of programmers (based on comments I've come across over the years) who
seem to think that representing (say) currency can only be done using
floating point numbers.

Simon.

-- 
Simon Clubley, clubley at remove_me.eisner.decus.org-Earth.UFP
Microsoft: Bringing you 1980s technology to a 21st century world



More information about the Info-vax mailing list