On 4/14/13 8:53 PM, Kim-Ee Yeoh wrote:
On Sun, Apr 14, 2013 at 3:28 PM, wren ng thornton w...@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
For better or worse; IEEE-754 settled many of these questions.
I personally think the standard is a good compromise of what's practical,
efficiently implementable, and mathematically sensible. I find the
following paper by Rummer and Wahl an especially good read:
On Sun, Apr 14, 2013 at 7:53 PM, Kim-Ee Yeoh k...@atamo.com wrote:
On Sun, Apr 14, 2013 at 3:28 PM, wren ng thornton w...@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
On 4/13/13 1:18 PM, Jerzy Karczmarczuk wrote:
This is not a Haskell problem. For Ints, ALL representations are valid
numbers, a NaN is a specific float object, unless I'm mistaken, so the
introduction of such an abnormal number would require some serious
modifications of the representation.
On Sun, Apr 14, 2013 at 3:28 PM, wren ng thornton w...@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
Hello haskellers,
is there a reason why Integer doesn't have 'NaN' as value?
I think it would be very convenient to be able to handle (1 `div` 0) as regular
NaN value and not as exception.
Thanks.___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Hello haskellers,is there a reason why Integer doesn't have 'NaN' as
value?I think it would be very convenient to be able to handle (1 `div` 0)
as regular NaN value and not as exception.Thanks.
I think because, if you need NaN like values, `Maybe Int` does the same job
without tainting the
You can always use the Maybe type as a follows:
intDiv :: Integer - Integer - Maybe Integer
intDiv _ 0 = Nothing
intDiv n m = Just (div n m)
This allows you to pattern match results of divisions:
example :: Integer - Integer - Maybe Integer
example n m =
case intDiv 4 n of
Nothing - Nothing
Franco answers a question :
Hello haskellers,is there a reason why Integer doesn't have 'NaN' as
value?I think it would be very convenient to be able to handle (1 `div` 0)
as regular NaN value and not as exception.Thanks.
I think because, if you need NaN like values, `Maybe Int` does the same