Libraries Digest, Vol 97, Issue 28

Howard B. Golden howard_b_golden at yahoo.com
Mon Sep 26 08:04:15 CEST 2011


On Mon, 26 Sep 2011 00:05:43 -0500 "Bryan O'Sullivan"
<bos at serpentine.com> wrote:
> On Sun, Sep 25, 2011 at 10:53 PM, Daniel Fischer <
> daniel.is.fischer at googlemail.com> wrote:
> 
> > Proposal: Provide Double and Float with Eq and Ord instances that introduce
> > a total order.
> >
> 
> I am strongly against this proposal, as it is in an area that is
> particularly poorly understood by most programmers (even experts). While the
> current behaviour may be undesirable from some points of view, at least it
> is consistent with most other programming languages - and this is one of the
> few areas where I think that's important.

I agree with BOS. If a totally ordered data type is desirable, it
shouldn't be called Float or Double. To do so violates the principle of
least astonishment.

As far as the proposal is concerned, if the types have different names,
then I agree mostly. However, it seems to me that such types _not_
include NaN, negative zero and the infinities, because they don't make
mathematical sense. Instead, the types should be Maybes that treat those
IEEE values as Nothing.

IEEE Floats and Doubles are _somewhat_ understood by those who need
them. The rest of us should be _very_ careful when using them!




More information about the Libraries mailing list