When I compile this C code and run it a dozen times on my machine, I get a different 9 digit negative number each time. Another clang compiler on another machine yields 10 digit positive integers that are different. I am expecting a strange value because right shifting by a negative count is undefined, but I am surprised that the value is not a single, unique number. Instead, I am get multiple values with the same input. Why is this not a mathematical function?
#include <stdio.h>
int main(void) {
printf("%d", 1 >> -1);
return 0;
}