To: X3J3 From: Keith Bierman Subject: Correspondence on rounding I've made minimal edits to David's and Robert's email on the topic. I believe that an appropriate resolution for this meeting would be a j3 note. The text of which follows these emails. From David Hough, once member of the IEEE754 standards group. JOR? Trying to specify rounding seems a little odd to me. Especially the way they want to do it. But in IEEE, round to nearest means pick the closer, or the even if halfway. round up means round toward +inf round down means round toward -inf round toward zero means round toward zero If you have a notion of an exact unrounded unrepresentable result, and a set of representable numbers, these definitions seem natural enough. -------------------- From Robert Corbett It is wrong, but it is what users want. We have received several complaints from users over the years that 0.5 rounds down to 0., but 1.5 rounds up to 2.. It would be nice to give users a mode that rounds the way humans round (halves round away from zero). It would be even nicer to make that rule the default. It would also be a good to supply a mode that uses the global rounding mode to determine how the formatting routines should round One could read the floating-point standard as saying that is how it must be done. I suspect DGH does read it that way, since that is how it works now. Yours truly, Bob Corbett Proposed J3 note: It seems likely that using the IEEE standards names, but using a different definition for NEAREST will be problematic. As the IEEE definition is not necessarily what "average consumers" expect, perhaps we should accommodate both the IEEE standard and "user expectation". NEAREST should be defined as per IEEE "round to nearest means pick the closer, or the even if halfway". Text to put this into the table to be crafted between meetings. The possibility of a mode called "FORTRAN" which would be defined as .5. It also may be worth considering removing the table in question entirely, and simply refer to the IEEE standard. J3 99-228 1/1