mpfr_libmpfr_sqrt_ui Method |
Set rop to the square root of op rounded in the direction rnd.
Namespace:
Math.Mpfr.Native
Assembly:
Math.Mpfr.Native (in Math.Mpfr.Native.dll) Version: 1.0.0.0 (1.0.0.0)
Syntaxpublic static int mpfr_sqrt_ui(
mpfr_t rop,
uint op,
mpfr_rnd_t rnd
)
Public Shared Function mpfr_sqrt_ui (
rop As mpfr_t,
op As UInteger,
rnd As mpfr_rnd_t
) As Integer
public:
static int mpfr_sqrt_ui(
mpfr_t^ rop,
unsigned int op,
mpfr_rnd_t rnd
)
static member mpfr_sqrt_ui :
rop : mpfr_t *
op : uint32 *
rnd : mpfr_rnd_t -> int
Parameters
- rop
- Type: Math.Mpfr.Nativempfr_t
The result floating-point number. - op
- Type: SystemUInt32
The operand floating-point number. - rnd
- Type: Math.Mpfr.Nativempfr_rnd_t
The rounding direction.
Return Value
Type:
Int32Return zero, a positive, or a negative value if
rop is respectively equal to, greater than, or lower than the exact result. See
GNU MPFR - Rounding Modes for details.
Remarks
Set rop to -0 if op is -0, to be consistent with the IEEE 754 standard.
Set rop to NaN if op is negative.
Examples
mpfr_t rop = new mpfr_t();
mpfr_lib.mpfr_init2(rop, 64U);
Assert.IsTrue(mpfr_lib.mpfr_sqrt_ui(rop, 100U, mpfr_rnd_t.MPFR_RNDN) == 0);
Assert.IsTrue(mpfr_lib.mpfr_get_d(rop, mpfr_rnd_t.MPFR_RNDN) == 10.0);
mpfr_lib.mpfr_clear(rop);
Dim rop As mpfr_t = New mpfr_t()
mpfr_lib.mpfr_init2(rop, 64U)
Assert.IsTrue(mpfr_lib.mpfr_sqrt_ui(rop, 100U, mpfr_rnd_t.MPFR_RNDN) = 0)
Assert.IsTrue(mpfr_lib.mpfr_get_d(rop, mpfr_rnd_t.MPFR_RNDN) = 10.0)
mpfr_lib.mpfr_clear(rop)
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