On Sun, Oct 7, 2012 at 8:00 PM, Michael Orlitzky <mich...@orlitzky.com> wrote: > I'm trying to use, > > http://hackage.haskell.org/package/numbers-3000.0.0.0 > > to get better precision "for free" out of some numerical code. I ran > into an issue pretty quickly, though. In Data.Number.BigFloat, we have, > > data BigFloat e = BF (Fixed e) Integer > deriving (Eq, Ord) > > and the derived Ord is obviously incorrect: > > Prelude Data.Number.BigFloat> let x = 0.1 :: BigFloat Prec50 > Prelude Data.Number.BigFloat> let y = 0.02 :: BigFloat Prec50 > Prelude Data.Number.BigFloat> x < y > True >
That's pretty strange since the derived Ord should be the same as Fixed Ord, which itself is just a newtype over Rational (and 1%10 < 2%100 == False), did you try to convert those BigFloat back to Rational to see if they're still correct ? That may be worse than a misbehaving Ord instance. -- Jedaï _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe