]> git.sur5r.net Git - cc65/blob - test/ref/cc65101209.c
Removed a "cc65_" prefix.
[cc65] / test / ref / cc65101209.c
1 /*
2   !!DESCRIPTION!! mod operator bug
3   !!ORIGIN!!      testsuite
4   !!LICENCE!!     Public Domain
5   !!AUTHOR!!      marcas
6 */
7
8 #include <stdlib.h>
9 #include <stdio.h>
10
11 int main(void) {
12      int tmp;
13
14      for (tmp = 0; tmp<=12345; tmp++)
15          if (!(tmp%1000)) printf("%d mod 1000 is %d\n", tmp, tmp%1000);
16
17     return 0;
18 }
19
20 /*
21 results in  (vice x64)
22 0 mod 1000 is 0
23 232 mod 1000 is 0
24 1000 mod 1000 is 0
25
26 Interesting:
27
28         1000    = $3E8
29         232     = $E8
30
31 So testing with 999 gives:
32
33 0 mod 999 is 0
34 231 mod 999 is 0
35 999 mod 999 is 0
36
37 This seems to be systematic. 
38 */