[Haskell-beginners] truncate results depend on strict/lazy
Oscar Benjamin
oscar.j.benjamin at gmail.com
Wed Sep 11 00:14:41 CEST 2013
On 10 September 2013 22:49, Brandon Allbery <allbery.b at gmail.com> wrote:
> On Tue, Sep 10, 2013 at 5:11 PM, Oscar Benjamin <oscar.j.benjamin at gmail.com>
> wrote:
>>
>> What do you mean when you say that floating point can't be capture in
>> a simple functional description?
>
> *You* try describing the truncation behavior of Intel FPUs (they use 80 bits
> internally but only store 64, for (double)). "Leaving aside" isn't an
> option; it's visible in the languages that use them.
However, for the same CPU and the same pair of inputs floatadd(A, B)
returns the same result right? The result may differ from one CPU to
another and it doesn't respect associativity etc. but it's still a
well defined function (if no one changes the rounding mode etc. midway
through computation). What is it about functional programming
languages that makes this difficult as you implied earlier?
Oscar
More information about the Beginners
mailing list