3 ms·
Off the top of my head: 1) Assuming rand(x,y) gives a uniform distribution between x and y: for (int a = 0; a < INT_MAX; a += rand(-1,1)); 2) I can't fin
by rcfox 13y ago
Off the top of my head:
1) Assuming rand(x,y) gives a uniform distribution between x and y:
for (int a = 0; a < INT_MAX; a += rand(-1,1));
2) I can't find the source any more, but someone basically implemented a big int library with bit twiddling to allow for an upper bound on a loop that would finish after the heat-death of the universe, assuming generous CPU specs. Not infinite, but also non-terminating.
3) Anything that makes a system call. You might never get scheduled again!