gmp_libmpf_get_d_2exp Method |
Convert op to a double, truncating if necessary (i.e. rounding towards zero), and with an exponent returned separately.
Namespace:
Math.Gmp.Native
Assembly:
Math.Gmp.Native (in Math.Gmp.Native.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax public static double mpf_get_d_2exp(
ptr<int> exp,
mpf_t op
)
Public Shared Function mpf_get_d_2exp (
exp As ptr(Of Integer),
op As mpf_t
) As Double
public:
static double mpf_get_d_2exp(
ptr<int>^ exp,
mpf_t^ op
)
static member mpf_get_d_2exp :
exp : ptr<int> *
op : mpf_t -> float
Parameters
- exp
- Type: Math.Gmp.NativeptrInt32
Pointer to 32-bit signed integer. - op
- Type: Math.Gmp.Nativempf_t
The operand float.
Return Value
Type:
DoubleThe return value is in the range 0.5 ≤ | d | < 1 and the exponent is stored at
exp. d * 2^
exp is the (truncated)
op value. If
op is zero, the return is 0.0 and 0 is stored at
exp.
Remarks Examples
gmp_lib.mpf_set_default_prec(64U);
mpf_t x = new mpf_t();
gmp_lib.mpf_init_set_d(x, -8.0);
ptr<int> exp = new ptr<int>(0);
Assert.IsTrue(gmp_lib.mpf_get_d_2exp(exp, x) == 0.5);
Assert.IsTrue(exp.Value == 4);
gmp_lib.mpf_clear(x);
gmp_lib.mpf_set_default_prec(64UI)
Dim x As New mpf_t()
gmp_lib.mpf_init_set_d(x, -8.0)
Dim exp As New ptr(Of Integer)(0)
Assert.IsTrue(gmp_lib.mpf_get_d_2exp(exp, x) = 0.5)
Assert.IsTrue(exp.Value = 4)
gmp_lib.mpf_clear(x)
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
See Also