Fast InvSqrt in Max

BlitzMax Forums/BlitzMax Programming/Fast InvSqrt in Max

Even faster, note the Var argument:
10%(!!) faster than Raw C on my machine with some first tests.

Function InvSqrtSOS_2:Float(x:Float Var)

    Local xhalf:Float = 0.5*x
    Local i:Int = $5f3759df - (Int Ptr(Varptr(x))[0] Shr 1)
    Local ox:Float = (Float Ptr(Varptr(i))[0])
    Return ox *(1.5 - (xhalf*ox*ox))

End Function