[Haskell-cafe] smallest double eps
Brandon Moore
brandonm at yahoo-inc.com
Sat Sep 30 19:10:31 EDT 2006
Bryan Burgers wrote:
>> >>> Hang on, hang on, now I'm getting confused.
>> >>> First you asked for the smallest (positive) x such that
>> >>> 1+x /= x
>> >>> which is around x=4.5e15.
>> >>
>> >> 1 + 0 /= 0
>> >>
>> >> 0 is smaller than 4.5e15
>> >>
>> >> So I don't understand this at all...
>> >
>> > But then 0 isn't positive.
>>
>> Why not?
>> In any case every positive number nust satisfy the above inequation
>> so what
>> about 0.1, which is certainly smaller than 4500000000000000?
People are confusing equality and inequality -
the nontrivial thing here is to find the smallest positive x
that satisfies the equation 1 + x == x.
> In math, every positive number must satisfy the above inequation, that
> is true. But as Chad said, the smallest number in Haskell (at least
> according to my GHC, it could be different with different processors,
> right?) that satisfies the equation is 2.2e-16.
And you've changed the subject - the stuff above was talking about
x + 1 /= x, you're demonstrating solutions to a different problem,
finding the smallest
x such that 1 + x == 1. That's the number often called epsilon.
>> 1 + 2.2e-16 /= 1
> True
>> 1 + 2.2e-17 /= 1
> False
Let's stop confusing ourselves about this.
Brandon
More information about the Haskell-Cafe
mailing list