Fix prelude definitions of abs/signum for Floats/Doubles
Levent Erkok
erkokl at gmail.com
Thu Apr 11 17:07:57 CEST 2013
On Thu, Apr 11, 2013 at 2:58 AM, Shachaf Ben-Kiki <shachaf at gmail.com> wrote:
>
>
> Maybe it would be simpler to say:
>
> signum x | x == 0 = x
> | isNaN x = x
> | x > 0 = 1
> | otherwise = negate 1
>
> Shachaf
>
Thanks Shachaf. This version is equivalent to the one I proposed, and it
saves one test; so it's definitely preferable. I'll put this one in the
ticket that'll finally be created for GHC.
-Levent.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20130411/cdb8c3fd/attachment.htm>
More information about the Libraries
mailing list