Click or drag to resize
mpfr_lib.mpfr_cbrt Method
Set rop to the cubic 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)
Syntax
public static int mpfr_cbrt(
	mpfr_t rop,
	mpfr_t op,
	mpfr_rnd_t rnd
)

Parameters

rop
Type: Math.Mpfr.Native.mpfr_t
The result floating-point number.
op
Type: Math.Mpfr.Native.mpfr_t
The operand floating-point number.
rnd
Type: Math.Mpfr.Native.mpfr_rnd_t
The rounding direction.

Return Value

Type: Int32
Return 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

This functions agrees with the rootn function of the IEEE 754-2008 standard (Section 9.2).

Examples
// Create, initialize, and set a new floating-point number op to 8.
mpfr_t op = new mpfr_t();
mpfr_lib.mpfr_init2(op, 64U);
Assert.IsTrue(mpfr_lib.mpfr_set_si(op, 8, mpfr_rnd_t.MPFR_RNDN) == 0);

// Create and initialize a new floating-point number rop.
mpfr_t rop = new mpfr_t();
mpfr_lib.mpfr_init2(rop, 64U);

// Set rop = cbrt(op).
Assert.IsTrue(mpfr_lib.mpfr_cbrt(rop, op, mpfr_rnd_t.MPFR_RNDN) == 0);

// Assert that the value of rop is 2.
Assert.IsTrue(mpfr_lib.mpfr_cmp_si(rop, 2) == 0);

// Release unmanaged memory allocated for rop and op.
mpfr_lib.mpfr_clears(rop, op, null);
See Also