From: Dennis Marsa (drm@xilinx.com)
Date: Mon May 05 2003 - 14:44:07 PDT
Precedence: bulk
Kurt Baty wrote:
>
> > Then I'm confused. If the rounding was "away from zero",
> > then wouldn't all of the combinations whose real result
> > is in the range (0.0,1.0) round to an integer result of 1,
> > and likewise results in the range (-1.0,0.0) would round to
> > a integer result of -1? Your test program results don't
> > indicate this.
>
> some functions:
>
> truncate -> real result in the range (0.0 <= fract < 1.0)
> goes to 0
> ceiling -> real result in the range (0.0 < fract <= 1.0)
> goes to 1
> round -> real result in the range (0.0 < fract < 0.50)
> goes to 0
> real result in the range (0.5 < fract <= 1.0)
> goes to 1
> real result is exactly (fract = 0.5)
> case(rounding mode)
> up: goes to 1 (round "away from zero")
> down: goes to 0 (round "towards zero")
> nearest: if(low bit of abs(integer) part is:
> zero: goes to 0
> one: goes to 1
>
> does this help?
Yes. I see what round away from zero really means now. Thanks.
Dennis
This archive was generated by hypermail 2.1.4
: Mon May 05 2003 - 14:44:50 PDT
and
sponsored by Boyd Technology, Inc.