Box2D.Common.MathUtils.FastPow C# (CSharp) Method

FastPow() public static method

public static FastPow ( float a, float b ) : float
a float
b float
return float
        public static float FastPow(float a, float b)
        {
            //UPGRADE_TODO: Method 'java.lang.Float.floatToRawIntBits' was converted to 'System.Convert.ToInt32' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javalangFloatfloatToRawIntBits_float'"
            float x = Convert.ToInt32(a);
            x *= INV_SHIFT23;
            x -= 127;
            //UPGRADE_WARNING: Data types in Visual C# might be different.  Verify the accuracy of narrowing conversions. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1042'"
            float y = x - (x >= 0 ? (int)x : (int)x - 1);
            b *= (x + (y - y * y) * 0.346607f);
            //UPGRADE_WARNING: Data types in Visual C# might be different.  Verify the accuracy of narrowing conversions. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1042'"
            y = b - (b >= 0 ? (int)b : (int)b - 1);
            y = (y - y * y) * 0.33971f;
            //UPGRADE_WARNING: Data types in Visual C# might be different.  Verify the accuracy of narrowing conversions. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1042'"
            return FloatToIntBits((int)((b + 127 - y) * SHIFT23));
        }