% operator (was Re: count of bits set in a long)
Georg Wittig
wittig at gmdzi.gmd.de
Tue Oct 2 00:05:38 AEST 1990
tac at cs.brown.edu (Theodore A. Camus) writes:
>However, 077 in octal is 63 in decimal, and I believe the following
^^^^^^^^^
>relationship is true : x % 63 = [(x % 64) + (x / 64)] % 63
Does there exist a proof for that equation? Can it be found in
literature? Is the following true?
x % n = (x%(n+1) + floor(x/(n+1))) % n (n != 0;n != -1)
Do there exist similar "surprising" equations?
--
Georg Wittig GMD-Z1.IT | wittig at gmdzi.gmd.de | "Freedom's just another word
P.O. Box 1240 | | for nothing left to lose"
D-5205 St. Augustin 1 | | (Kris Kristofferson)
West Germany | (+49) 2241 14-2294 |
More information about the Comp.lang.c
mailing list