floating: Use nearbyint instead of round in fquotRem.
commitb468aa921e135c34a90e332d6593c72caf99d585
authorNick Bowler <nbowler@draconx.ca>
Fri, 5 Feb 2010 17:18:53 +0000 (5 12:18 -0500)
committerNick Bowler <nbowler@draconx.ca>
Fri, 5 Feb 2010 22:34:02 +0000 (5 17:34 -0500)
tree7b864f355c68e236692431305d8df547f27b5ebd
parenta43efc441a9844970efab7be95f574aa2c0c43d2
floating: Use nearbyint instead of round in fquotRem.

The remainder function rounds halfway values to even, while the round
function rounds halfway values away from zero.  This is obviously wrong,
so use nearbyint which also rounds halfway to even, at least in the
pure case.

In the FEnv case, changing the rounding mode now affects the quotient,
which is probably wrong.  So this change probably just trades an old
bug for a new, less important one.
Data/Floating.hs
c99-compat.c