On Mon, 17 Sep 2012, Vincent Lefevre wrote:

> Then, between implementing round-to-odd and implementing a direct
> formatOf operation, I don't think there is much difference concerning
> the work to do (I would even say that round-to-odd could require more
> work).

The difference would probably be that round-to-odd involves a temporary 
(and probably expensive) change to the rounding mode to round towards zero 
- whereas other approaches (one of which might be using Dekker's / Knuth's 
algorithms to compute an exact sum or product, then using the low part of 
that to adjust the high part before rounding to the desired format) could 
be done without such a change.

(With direct software floating-point implementations on a processor that 
has hardware floating point, you also need to ensure that the final result 
is rounded according to the current rounding direction and that 
appropriate exceptions are raised - maybe through using the software 
floating point to produce directly the adjusted value in a wider format, 
then the hardware floating point to round that to the narrower format.)

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to