#include #include /* Use: `grep xxx AlienHz.c` where xxx is the second word on next line: gcc -Wall -W -pedantic -O3 -ffast-math -lm -o AlienHz AlienHz.c */ int main(void) { int Index,d; double base, exp; const double Bases[] = { 1, 3.141592653589793238462643383279502884197169399375105820974944592, 2.718281828459045235360287471352662497757247093699959574966967628, 1.41421356237309504880168872420969807856967187537694807317667973, 0 }; printf( "The most probable messaging frequencies between 800 MHz .. 3 GHz\n" "\n" "Based on the following base numbers, multiplicated with\n" "several possible number system bases raised to 4..30 power:\n"); for(Index=0; Bases[Index] != 0; Index++) printf("%.15f ", Bases[Index]); printf("\n(One, pi, e and sqrt(2))\n\n"); for(d=0,base=2; base<32; base++) for(exp=4; exp<30; exp++) { double res, mul=pow(base, exp); for(Index=0; (res=Bases[Index]) != 0; Index++) { res *= mul; if(res >= 800E6 && res <= 3E9) /* 800 MHz .. 3 GHz */ { if(d++%4==3)printf("\n"); printf("%16.10f MHz", res / 1E6); } } } printf("\n(%d)\n", d); return 0; }