Sicuramente Axet, guarda io ho scritto questo:
Ed è alquanto chiaro, ma evidentemente sei molto bravo a scrivere codice e poco a leggere un libro, punti di vista :)
A dimostrarti ancor, come se non si fosse già capito, che l'estetica != funzionalità. Il codice di seguito, è l'inverso della radice quadrata, scritto da Carmack per Quake 3 Arena, operazione che va come un treno, sicuramente molto leggibile....
Code:
float Q_rsqrt (float number)
{
long i;
float x2, y;
const float threehalfs = 1.5F;
x2 = number * 0.5F;
y = number;
// evil floating point bit level hacking [sic]
i = * ( long * ) &y;
// what the fuck? [sic]
i = 0x5f3759df - ( i >> 1 );
y = * ( float * ) &i;
// 1st iteration
y = y * ( threehalfs - ( x2 * y * y ) );
return y;
}
Arrogante come sei dirai che non è vero. Link :
http://en.wikipedia.org/wiki/Fast_inverse_square_root
Ora tornatene a spingere l'alfa nella notte.