[Haskell-cafe] instance Enum Double considerednotentirelygreat?

Steve Schafer steve at fenestra.com
Tue Sep 27 18:36:59 CEST 2011


On Tue, 27 Sep 2011 09:23:20 -0700 (PDT), you wrote:

>I think it's more than reasonable to expect
>
>  [0.1,0.2..0.5] == [0.1,0.2,0.3,0.4,0.5]
>
>and that would make everyone happy, wouldn't it?

[0.1,0.2..0.5] isn't the problem. The problem is coming up with
something that not only works for [0.1,0.2..0.5], but also works for
[0.1,0.2..1234567890.5].

A good rule of thumb: For every proposal that purports to eliminate
having to explicitly take into consideration the limited precision of
floating-point representations, there exists a trivial example that
breaks that proposal.

-Steve Schafer



More information about the Haskell-Cafe mailing list