Repair to floating point enumerations?
isaacdupree at charter.net
Thu Oct 16 17:31:50 EDT 2008
Christopher Lane Hinson wrote:
> I agree with David, we should be using multiplication, not addition.
> However, I think that under the law of least surprise, we should
> require that for all a,b,z:
> all (\x -> x >= a && x < z || x <= a && x > z) [a,b..z].
so that [0,0.1..0.3] doesn't include the terminating value
that's a little more than the literal 0.3?
> For example, anything in the neighborhood of this is just unfair, even
> if it's within David's fudge factor:
> Prelude> map (\x -> 1 / (x-0.6)) [0,0.1..0.55]
but that's a significant fudge, 0.5 versus 0.55 versus 0.6
More information about the Libraries