Name: Anonymous 2008-06-04 10:39
GO!
#include <limits.h>
#include <stdint.h>
#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L
#error Please use a compiler that supports the C99 standard to compile this file.
#endif
void sort(uintmax_t *numbers, size_t length){
uintmax_t temp[length], *arrays[2] = {numbers, temp};
for(uint_fast8_t i = 0; i < sizeof(uintmax_t) * CHAR_BIT; ++i)
for(size_t j = 0, start = 0, end = length - 1; j < length; ++j){
if(!(arrays[i & 1][j] & 1 << i))
arrays[i & 1 ^ 1][start++] = arrays[i & 1][j];
if(arrays[i & 1][length - j - 1] & 1 << i)
arrays[i & 1 ^ 1][end--] = arrays[i & 1][length - j - 1];
}}