[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ROUNDing



    Date: Thu, 27 Jun 1991 05:29 EDT
    From: kddlab!atr-la.atr.co.jp!myers@uunet.UU.NET (John K. Myers)

    What is the rationale for having ROUND round to the nearest
    even integer on a .5 boundary, instead of rounding down in every case?
    Does it make it easier to implement?  Not rounding down
    creates beat frequencies in my numeric representations.
    I'd vote for having the standard changed next time.
    Unless, is there a graphics application or something that likes
    having ROUND wobble?

I believe it's a `fairness' issue. e.g., how would you like it if your bank
used ROUND-DOWN on every computation?  Changing it back the other way would
just cause us to get messages from a different camp asking it to change back.
To paraphrase you, "Is there a user community that likes having ROUND's
definition wobble?"

To satisfy everyone, probably the right thing would have been to provide
several more functions, since the issue is not really "what should ROUND's
definition be", but rather "what should be the names for each of the
several possible legitimate rounding operations".  (We did better than some
previous standards by offering the four called ROUND, TRUNCATE, FLOOR, and 
CEILING.  Some languages offer only a subset of those.)

It's possible that the strategies need to vary enough that perhaps we
should have offered something like:
  (round x y :if-in-between #'(lambda (value) ...))