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:
parent
1e29126690
commit
c9ff85fc13
@ -117,7 +117,7 @@ namespace MPIR.Tests.HugeIntTests
|
|||||||
var source = Platform.Select(-123.45e20, -123.45e19);
|
var source = Platform.Select(-123.45e20, -123.45e19);
|
||||||
var zillion = Platform.Ui(10000000000U, 1000000000U);
|
var zillion = Platform.Ui(10000000000U, 1000000000U);
|
||||||
var factor = Platform.Ui(1, 10);
|
var factor = Platform.Ui(1, 10);
|
||||||
var exp = 0;
|
var exp = Platform.Si(0, 0);
|
||||||
|
|
||||||
a.SetTo(source);
|
a.SetTo(source);
|
||||||
lo.Value = (a/zillion).Rounding(RoundingModes.Floor);
|
lo.Value = (a/zillion).Rounding(RoundingModes.Floor);
|
||||||
|
@ -1674,11 +1674,10 @@ namespace MPIR
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="exp">variable to store the exponent in.</param>
|
/// <param name="exp">variable to store the exponent in.</param>
|
||||||
/// <returns>The mantissa of the value as a double, possibly truncated.</returns>
|
/// <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;
|
double result;
|
||||||
auto result = MP(get_d_2exp)(&x, _value);
|
exp = MP(get_2exp_d)(&result, _value);
|
||||||
exp = x;
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user