On Tue, Sep 24, 2013 at 11:36 AM, Stijn van Drongelen <rhym...@gmail.com>wrote:

> On Tue, Sep 24, 2013 at 5:39 PM, Sven Panne <svenpa...@gmail.com> wrote:
>
>> 2013/9/22 Mike Meyer <m...@mired.org>:
>> > On Sat, Sep 21, 2013 at 5:28 PM, Bardur Arantsson <s...@scientician.net
>> >
>> > wrote:
>> > Trying to make something whose name is "Not A Number" act like a
>> > number sounds broken from the start.
>>
>> The point here is that IEEE floats are actually more something like a
>> "Maybe Float", with various "Nothing"s, i.e. the infinities and NaNs,
>> which all propagate in a well-defined way.
>
>
> So, `Either IeeeFault Float`? ;)
>

Sort of, but IeeeFault isn't really a zero.   Sometimes they can get back
to a normal Float value:

  Prelude> let x = 1.0/0
  Prelude> x
  Infinity
  Prelude> 1/x
  0.0

Also, IEEE float support doesn't make sense as a library, it needs to be
built into the compiler (ignoring extensible compiler support via the
FFI).  The whole point of IEEE floats is that they're very fast, but in
order to take advantage of that the compiler needs to know about them in
order to use the proper CPU instructions.  Certainly you could emulate them
in software, but then they'd no longer be fast, so there'd be no point to
it.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to