Esempio n. 1
0
 private void Convert()
 {
     number10 = new ExpNumber(number, 10);
     number2 = new ExpNumber(number, 2);
     numberR = GetNumberR(number2);
     mantisa2 = ConvertMantisa(number2.Significand);
     exponent2 = ConvertExponent(number2.Exponent);
 }
Esempio n. 2
0
 private ExpNumber GetNumberR(ExpNumber number2)
 {
     double step = 1;
     double numberX = step;
     string mantisaX = ConvertMantisa(number2.Significand);
     for (int idx = 0; idx < mantisaX.Length; idx++)
     {
         step /= 2;
         if (mantisaX[idx] == '1')
             numberX += step;
     }
     if (number2.Significand < 0)
         numberX *= -1;
     numberX *= Math.Pow(2, number2.Exponent);
     return new ExpNumber(numberX, 10);
 }