Weekdays are the typical example, imh:
-- cut -- #include <stdio.h>
int main() { int i; for (i=-10; i<=10; i++) printf("day %3d has weekday %d\n",i,i%7); return 0; } -- end cut --
day -10 has weekday -3 day -9 has weekday -2 day -8 has weekday -1 day -7 has weekday 0 day -6 has weekday -6 day -5 has weekday -5 day -4 has weekday -4 day -3 has weekday -3 day -2 has weekday -2 day -1 has weekday -1 day 0 has weekday 0 day 1 has weekday 1 day 2 has weekday 2 day 3 has weekday 3 day 4 has weekday 4 day 5 has weekday 5 day 6 has weekday 6 day 7 has weekday 0 day 8 has weekday 1 day 9 has weekday 2 day 10 has weekday 3
/ Mirar
Previous text:
2003-01-15 17:51: Subject: Re: signed integer division
On Wed, Jan 15, 2003 at 05:10:04PM +0100, Niels Möller () @ Pike (-) developers forum wrote:
Hmm, I hope this is exported, or that Martin reads the lyskom conference.
both, i am reading the conference via the exported list :-) i do understand the thing as far as math goes, what i am looking for is an example of a practical application that would break if you round towards 0.
greetings, martin.
/ Brevbäraren