Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: Motion P1788/0024.01: Rounding Mode as Operation



I'm glad I waited before I replied, because Hossam Fahmy did all the
work for me!  He covered all the points I was going to make, and then
some.

I think there is a generic way of rephrasing the essence of the motion:

   Every (essential) IEEE-754 arithmetic operation shall be provided
   in a form with an explicit rounding direction, in addition to the
   usual forms that respect a static global rounding direction.  All
   rounding modes provided for a given radix shall also be supported
   in this manner.

Whether this is done via an additional parameter, or via a different
operation name, is (just like the actual names of operators or functions)
beyond the scope of the standard, as it falls within the purview of
language and library standards.

I might also point to two existing implementations of this motion,
both for DFP only at this point:

   The decNumber library, where each operation has (besides the numeric
   operands) a context argument.  This context contains (among other
   things) the rounding direction for this operation.  (A global rounding
   direction would simply be in a common context object.)

   The DFP arithmetic instructions of IBM's z196 processor, where each
   opcode includes a rounding mode field.  Among those rounding modes
   is the inherited rounding mode from the global FPC register.

Michel.
---Sent: 2011-04-18 18:43:04 UTC