[Fix] BigInteger: improved cast to double
authortheraot <theraot@gmail.com>
Tue, 4 Mar 2014 18:59:11 +0000 (13:59 -0500)
committertheraot <theraot@gmail.com>
Tue, 4 Mar 2014 18:59:11 +0000 (13:59 -0500)
commitf2dd91de168665f927d5dbe450944622a3af2d5c
treeac66f60a0d9995a8200c7f77c6ab262e5fa7455c
parent7d235768550516fc9132f0894130f3398ad8045a
[Fix] BigInteger: improved cast to double

- Added overloads for PopulationCount and LeadingZeroCount that take ulong.
- Added helper method BuildDouble that constructs a double by sign, mantissa
  and exponent. This method truncates the mantissa, thus may differ in
  rounding to Math.Pow.
- The new implementation avoids Math.Pow by using BuildDouble.
- Passing all recently added tests.
mcs/class/System.Numerics/System.Numerics/BigInteger.cs