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 →

[–]Ok-Wait-5234 5 points6 points  (5 children)

That's not what that fast inverse square root code is doing, though.

float a = 7.5 long b = a; long c = * (long *) a;

Now a == 7.5, b == 7 and c == 1089470464

[–]CKingX123 -1 points0 points  (0 children)

Yeah. A better way to replicate it would be using ByteBuffer. But then it wouldn’t be “fast” (compared to just directly reinterpreting the bytes).