ekmett / rounded

MPFR bindings for Haskell
http://hackage.haskell.org/package/rounded
BSD 3-Clause "New" or "Revised" License
34 stars 13 forks source link

Documentation of rounding modes #14

Closed dmcclean closed 6 years ago

dmcclean commented 10 years ago
data RoundingMode
  = TowardNearestWithTiesAwayFromZero
  | TowardNearest
  | TowardZero
  | TowardInf
  | TowardNegInf
  | AwayFromZero
  | Faithfully
  deriving (Eq,Ord,Show,Read,Data,Typeable)

I have a few questions.

  1. What does "Faithfully" mean? Google lead me around in circles and I couldn't figure it out.
  2. If TowardNearestWithTiesAwayFromZero has to deal with ties, what does TowardNearest do with ties?
  3. It seems (naively, I don't know anything about this) that any of the Toward... or AwayFrom... methods could be the one you wanted to use to resolve ties, which suggests jiggling constructors around?
ekmett commented 10 years ago

The names are based on the rounding mode names in the MPFR header (as is their order). I'd be happy to take docs explaining their behavior.

http://code.woboq.org/gcc/include/mpfr.h.html#79 https://gforge.inria.fr/tracker/index.php?func=detail&aid=6190&group_id=136&atid=622

faithful is at last check a placeholder.

dmcclean commented 10 years ago

Cool. Forthcoming.

claudeha commented 6 years ago

fixed in https://github.com/ekmett/rounded/pull/27 merge