Hacker News new | past | comments | ask | show | jobs | submit login

I would say that the actual source code there is extremely ugly. It may be an elegant solution, but there's no way I would want to crawl around in that repo:

    x2 = number * 0.5F;
	y  = number;
	i  = * ( long * ) &y;                               // evil floating point bit level hacking
	i  = 0x5f3759df - ( i >> 1 );               
    // what the fuck? 
	y  = * ( float * ) &i;



Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: