Go Home Gamergirl Thread

Nevermind, I'm a faggot who didn't read the left side. Still, why would you ever not comment a function unless it's completely obvious what it's meant to be used for? Square root of what, and for what purpose?

...

The only really bad thing about the girls code is "return 5;", making it so that if a and b are equal, you get 5. Which is just beyond stupid. And well, the fact that nearly 5 lines of actual code are wasted (not even the comments), but a good compiler would likely ignore those anyway, if it wasn't for the return 5 part.

The guys code could obviously use some comment, but I am pretty sure that is from a certain, optimized, way of doing maths in some specific field, that nearly anybody who would ever work with that code would understand what it does.

float InvSqrt(float x){ float xhalf = 0.5f * x; int i = *(int*)&x; // store floating-point bits in integer i = 0x5f3759df - (i >> 1); // initial guess for Newton's method x = *(float*)&i; // convert new bits into float x = x*(1.5f - xhalf*x*x); // One round of Newton's method return x; }

betterexplained.com/articles/understanding-quakes-fast-inverse-square-root/

/********//*nigger*//********/

I thought I heard about it before.

Fuck

if you read the function name you would know what it is

I agree, it should be nothing but slashes. Using asterisks for a visually blocky comment is disgusting.

Don't worry, I've been doing this shit for years and it's confusing as fuck for me too.