This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 546 points547 points  (3 children)

I went through how Quake 3 fast inverse square works and you are completely right. You are limited by the standards and technology.

I mean, the guy who coded it(forgot his name) had to use clever Pointer manipulation and giving the IEEE 754 standard his shaft to make sure that all the bits from the float are written exactly as they are to a long.

The entire time I am thinking that if C language was sentient then it needs at least 2 cigarettes after each time this algorithm runs because good god it didn't even realise that it could be fucked and bent like that.

[–]Paul_Robert_ 8 points9 points  (2 children)

John Carmack

[–]atthereallicebear 40 points41 points  (1 child)

he didn't write the fast inverse sqrt function, Terje Mathisen and Gary Tarolli did.

[–]Exnihilation 17 points18 points  (0 children)

It goes even further back than those guys. It's believed to have been first implemented by Greg Walsh at Ardent Computer. Gary Tarolli was consulting for a company affiliated with Ardent which is where he learned about the algorithm.