On Fri, Feb 5, 2010 at 1:44 AM, Johannes Bauer jb@gmx.de wrote:
Dear list,
I'm trying to do rounded (opposed to truncated) integer division with
avr-gcc with using only preprocessor magic. This proves to be difficult: The
current code I'm using is
#define __IDIV(x, y) (long)(((long)x
From: jb@gmx.de:
I'm trying to do rounded (opposed to truncated) integer division with
avr-gcc with using only preprocessor magic. This proves to be difficult:
The current code I'm using is
#define __IDIV(x, y) (long)(((long)x + ((long)y / 2L)) / (long)y)
#define IDIV(x, y)