Mail Archives: djgpp/1999/09/23/16:29:50
Oliver Roese (oroese AT edina DOT xnc DOT com) wrote:
:
: Martin Stromberg <eplmst AT lu DOT erisoft DOT se> schrieb in im Newsbeitrag:
: 7scukd$rm6$1 AT antares DOT lu DOT erisoft DOT se...
: (...)
: >
: > Well... Obviously(?) x/3 == 1431655766*x + (x<0?1:0) (mod 2^32)
: > Or perhaps (mod 2^32) should be (mod 2^31)...
: >
: > It's very probably mathematically provable using rings and fields and
: such.
: >
:
: The above equation cannot hold, since x/3 is fractional most of the
: time.
You are missing the fact that we are operating on the ring Z(2^32), so
the mapping is Z(2^32) -> Z(2^32) on the division operation, where /3
is a special case.
: Even if this was a mistake and you meant floor(x/3), the equation cannot
: hold, since
: floor(x/n) is a staircase function.
floor() is something which operates on R or (in computers) floating
point. We are dealing with integers here (and in this case, a subset
of them, Z(2^32)).
Right,
MartinS
- Raw text -