/* testgen.c */ /* Written 7/21/2022 by Cedar Turek This program creates test vectors for modulo calculation from integer divide. */ /* #includes */ #include #include #include /* Constants */ #define ENTRIES 10 #define RANDOM_VECS 500 /* Prototypes */ void output(FILE *fptr, long a, long b, long rem); void printhex(FILE *fptr, long x); double random_input(void); /* Main */ void main(void) { FILE *fptr; long a, b, rem; long list[ENTRIES] = {1, 3, 5, 18, 25, 33, 42, 65, 103, 255}; int i, j; if ((fptr = fopen("modtestvectors","w")) == NULL) { fprintf(stderr, "Couldn't write testvectors file\n"); exit(1); } for (i=0; i