Пример #1
0
 /// <summary>
 /// This computes the number of common most-significant bits in the mantissa.
 /// It does not count the hidden bit, which is always 1.
 /// It does not determine whether the numbers have the same exponent - if they do
 /// not, the value computed by this function is meaningless.
 /// </summary>
 /// <param name="db"></param>
 /// <returns> The number of common most-significant mantissa bits.</returns>
 public int NumCommonMantissaBits(DoubleBits db)
 {
     for (int i = 0; i < 52; i++)
     {
         if (GetBit(i) != db.GetBit(i))
         {
             return(i);
         }
     }
     return(52);
 }
Пример #2
0
 /// <summary> 
 /// This computes the number of common most-significant bits in the mantissa.
 /// It does not count the hidden bit, which is always 1.
 /// It does not determine whether the numbers have the same exponent - if they do
 /// not, the value computed by this function is meaningless.
 /// </summary>
 /// <param name="db"></param>
 /// <returns> The number of common most-significant mantissa bits.</returns>
 public int NumCommonMantissaBits(DoubleBits db)
 {
     for (int i = 0; i < 52; i++)
     {
     if (GetBit(i) != db.GetBit(i))
         return i;
     }
     return 52;
 }