[yoshimi] Re: Rounding again.
- From: Ichthyostega <prg@xxxxxxxxxxxxxxx>
- To: yoshimi@xxxxxxxxxxxxx
- Date: Mon, 29 Oct 2018 02:36:45 +0100
On 10/26/18 1:39 AM, Will Godfrey wrote:
However there are quite a lot of times where we want rounding to nearest,
and from what I've read, to avoid an anomaly about zero, 0.5 needs to go
towards 1, and -0.5 needs to go to zero (or the other way round). i.e.
everything moves in the same direction.
Good point. This kind of stuff becomes very relevant when you do numerical
math, and especially statistics simulations. If you round biassed, as you
propose, then in fact you introduce a global DC offset or drift, but no
relative anomaly. In many cases this is the best you can do. It can be
problematic however, when you repeatedly round and re-round the same
The mathematicians often also use "half-even" rounding, especially when
this aforementioned DC offset is problematic. Of course, half-even rounding
always costs a tiny little bit of performance.
Bottom line, just from general reasoning, your proposed approach seems
reasonably for me. And yes, I'd be interested in your proof of concept
code, and also the actual microbenchmark numbers you got.
Yoshimi source code is available from either:
Our list archive is at: https://www.freelists.org/archive/yoshimi
To post, email to yoshimi@xxxxxxxxxxxxx
Other related posts: