Fix prelude definitions of abs/signum for Floats/Doubles

Daniel Fischer daniel.is.fischer at googlemail.com
Mon Apr 22 01:23:25 CEST 2013


On Sunday 21 April 2013, 16:15:09, Shachaf Ben-Kiki wrote:
> On Sun, Apr 21, 2013 at 4:10 PM, Daniel Fischer
> 
> <daniel.is.fischer at googlemail.com> wrote:
> > Also
> > 
> >     abs x
> >     
> >         | x < 0 = negate x
> >         | otherwise = x
> > 
> > keeps the number of tests at one.
> 
> This gives the wrong result for -0.0 (which is compare-equal to +0.0).
> 
>     Shachaf

Duh. Sorry.



More information about the Libraries mailing list