Box2D.Common.MathUtils.Pow C# (CSharp) Метод

Pow() публичный статический Метод

Computes a fast approximation to Math.pow(a, b). Adapted from http://www.dctsystems.co.uk/Software/power.html.
public static Pow ( float a, float b ) : float
a float a positive number
b float a number
Результат float
        public static float Pow(float a, float b)
        {
            // adapted from: http://www.dctsystems.co.uk/Software/power.html
            if (Settings.FAST_MATH)
            {
                //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 *= 1.0f / (1 << 23);
                x = x - 127;
                float y = x - Floor(x);
                b *= (x + (y - y * y) * 0.346607f);
                y = b - Floor(b);
                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) * (1 << 23)));
            }
            else
            {
                //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 (float)Math.Pow(a, b);
            }
        }