Ubuntu – The result of the bitwise operation exceeds the maximum possible value
#include <stdio.h> #include <time.h> #include <stdlib.h> #define COUNTS 1000000 int f2() { struct timespec ts; if (clock_gettime(CLOCK_REALTIME, &ts) == -1) { perror("clock_gettime"); return 1; } srand(ts.tv_nsec); int num; do { num = (int)((double) (rand() / ((double)RAND_MAX + 1.0))*5) + 1;…