[E-Lang] Operators #6: Multiplicative operators

Mark S. Miller markm@caplet.com
Mon, 23 Apr 2001 12:08:31 -0700


At 10:29 AM Monday 4/23/01, Ben Laurie wrote:
>"Mark S. Miller" wrote:
>> I believe in the IEEE context, "round to nearest" actually means "round to
>> even".
>
>I don't understand what you mean by that - but 1 should round up, of
>course (for the same reason 5 does in decimal).

I believe the IEEE "round to even" means: when there's an unambiguous 
nearest, take that.  When, the true value is exactly half way between the 
representable values, choose the representable value whose low order bit is 
0 rather than 1.  So, using your decimal analogy:

    1.5  rounds to  2
    2.5  rounds to  2
    3.5  rounds to  4

I take no stance on whether this is a good idea.  It's mandated by IEEE and 
inherited by Java, so it's what we've got.


        Cheers,
        --MarkM