[Haskell-cafe] NaN as Integer value

Gabriel Dos Reis gdr at integrable-solutions.net
Mon Apr 15 12:16:36 CEST 2013


On Sun, Apr 14, 2013 at 7:53 PM, Kim-Ee Yeoh <ky3 at atamo.com> wrote:
> On Sun, Apr 14, 2013 at 3:28 PM, wren ng thornton <wren at freegeek.org> wrote:
>> Whereas the problematic
>> values due to infinities are overspecified, so no matter which answer you
>> pick it's guaranteed to be the wrong answer half the time.
>>
>> Part of this whole problem comes from the fact that floats *do* decide to
>> give a meaning to 1/0 (namely Infinity).
>
> I'm not sure what you mean about overspecification here, but in
> setting 1/0 as +infinity (as opposed to -infinity), there's an easily
> overlooked assumption that the limit is obtained "from above" as
> opposed to "from below."

Not quite.  0.0 designates "positive zero" or +0.0 in IEEE 754 notation.
There is also "negative zero" or -0.0 in IEEE 754 notation.  If you want
the limit from below, use negative zero.  This is all standard IEEE
754 concepts.

-- Gaby



More information about the Haskell-Cafe mailing list