monome / teletype

monome eurorack module
GNU General Public License v2.0
197 stars 83 forks source link

Behaviour of AVG and Q.AVG? #38

Closed samdoshi closed 6 years ago

samdoshi commented 8 years ago

At the moment AVG and Q.AVG perform integer division when calculating the average.

e.g.

AVG 2 3
>>> 2

Should they round instead?

tehn commented 8 years ago

i can definitely see that as being desirable!

On Thu, Apr 14, 2016 at 10:05 AM, Sam Doshi notifications@github.com wrote:

At the moment AVG and Q.AVG perform integer division when calculating the average.

e.g.

AVG 2 3

2

Should they round instead?

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/monome/teletype/issues/38

burnsauce commented 6 years ago

In the PR, AVG -32767 -32768 == -32767 and AVG 32766 32767 == 32767, which is "round up" not "round away from zero".

burnsauce commented 6 years ago

GNU C round() goes away from zero.

tehn commented 6 years ago

let's do that then.

On Tue, Sep 12, 2017 at 11:29 AM, Poindexter Frink <notifications@github.com

wrote:

GNU C round() goes away from zero.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/monome/teletype/issues/38#issuecomment-328871455, or mute the thread https://github.com/notifications/unsubscribe-auth/AAPEcPHiD77jlMHoUHrgnUy2KVPg_j0aks5shpXrgaJpZM4IHZvU .