3

の BCL Codeplex 実装を使用していますが、 2 つのをBigRational受け取ることができる Pow メソッドはないようです。自分で書きたいのですが、どこから始めればよいかわかりません。編集:いくつかのコード:BigRationalBigRationalBigInteger

        public static BigRational Pow(BigRational baseVal, BigRational exponent, int inputPrecision)
    {
        if (exponent == 0)
        {
            return BigRational.One;
        }
        if (exponent == 1)
        {
            return baseVal;
        }
        if (exponent.GetWholePart() == exponent)
        {
            return Pow(baseVal, exponent.GetWholePart());
        }
        baseVal = Round(baseVal, inputPrecision); //custom rounding method
        exponent = Round(exponent, inputPrecision); 
        BigInteger exponentWhole = exponent.GetWholePart();
        BigRational extra = exponent - exponentWhole;
        return //what?
    }
4

0 に答える 0