| mpfr_libmpfr_init_set_q Method | 
 
            Initialize rop and set its value from 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
Syntaxpublic static int mpfr_init_set_q(
	mpfr_t rop,
	mpq_t op,
	mpfr_rnd_t rnd
)
Public Shared Function mpfr_init_set_q ( 
	rop As mpfr_t,
	op As mpq_t,
	rnd As mpfr_rnd_t
) As Integer
public:
static int mpfr_init_set_q(
	mpfr_t^ rop, 
	mpq_t^ op, 
	mpfr_rnd_t rnd
)
static member mpfr_init_set_q : 
        rop : mpfr_t * 
        op : mpq_t * 
        rnd : mpfr_rnd_t -> int 
Parameters
- rop
- Type: Math.Mpfr.Nativempfr_t
 The result floating-point number.
- op
- Type: Math.Gmp.Nativempq_t
 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
Remarks Examples
Examples
mpq_t op = "1/1";
mpfr_t rop = new mpfr_t();
Assert.IsTrue(mpfr_lib.mpfr_init_set_q(rop, op, mpfr_rnd_t.MPFR_RNDN) == 0);
Assert.IsTrue(mpfr_lib.mpfr_get_si(rop, mpfr_rnd_t.MPFR_RNDN) == 1);
mpfr_lib.mpfr_clear(rop);
gmp_lib.mpq_clear(op);
Dim op As mpq_t = "1/1" 
Dim rop As mpfr_t = New mpfr_t()
Assert.IsTrue(mpfr_lib.mpfr_init_set_q(rop, op, mpfr_rnd_t.MPFR_RNDN) = 0)
Assert.IsTrue(mpfr_lib.mpfr_get_si(rop, mpfr_rnd_t.MPFR_RNDN) = 1)
mpfr_lib.mpfr_clear(rop)
gmp_lib.mpq_clear(op)
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
See Also