Switched MPIR.Net HugeInt.ToDouble(out exp) method to use mpz_get_2exp_d instead of mpz_get_d_2exp

This commit is contained in:
Alex Dyachenko 2019-06-28 14:51:15 -04:00
parent 1e29126690
commit c9ff85fc13
2 changed files with 5 additions and 6 deletions

View File

@ -117,7 +117,7 @@ namespace MPIR.Tests.HugeIntTests
var source = Platform.Select(-123.45e20, -123.45e19);
var zillion = Platform.Ui(10000000000U, 1000000000U);
var factor = Platform.Ui(1, 10);
var exp = 0;
var exp = Platform.Si(0, 0);
a.SetTo(source);
lo.Value = (a/zillion).Rounding(RoundingModes.Floor);

View File

@ -1674,11 +1674,10 @@ namespace MPIR
/// </summary>
/// <param name="exp">variable to store the exponent in.</param>
/// <returns>The mantissa of the value as a double, possibly truncated.</returns>
double ToDouble([Out] mp_exp_t% exp)
double ToDouble([Out] mpir_si% exp)
{
mp_exp_t x;
auto result = MP(get_d_2exp)(&x, _value);
exp = x;
double result;
exp = MP(get_2exp_d)(&result, _value);
return result;
}