How to implement the "fast inverse square root" in Java?
===

I've heard of the "fast inverse square root", [discussed here][1], and I wanted to put it in my Java program (it's only going to be used on low graphics settings, so ignore anything about the FPU being faster).

I was looking at the code, and the C code directly converts the `float` into an `int`. If you try to do this in Java with casts, it doesn't work: java truncates the float (as you would expect), and you can't get the pointer of a primitive (as you can in C).
So how do you do this?


  [1]: http://stackoverflow.com/questions/1349542/john-carmacks-unusual-fast-inverse-square-root-quake-iii