| mpfr_libmpfr_add_d Method | 
 
            Set rop to op1 + op2 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_add_d(
	mpfr_t rop,
	mpfr_t op1,
	double op2,
	mpfr_rnd_t rnd
)
Public Shared Function mpfr_add_d ( 
	rop As mpfr_t,
	op1 As mpfr_t,
	op2 As Double,
	rnd As mpfr_rnd_t
) As Integer
public:
static int mpfr_add_d(
	mpfr_t^ rop, 
	mpfr_t^ op1, 
	double op2, 
	mpfr_rnd_t rnd
)
static member mpfr_add_d : 
        rop : mpfr_t * 
        op1 : mpfr_t * 
        op2 : float * 
        rnd : mpfr_rnd_t -> int 
Parameters
- rop
- Type: Math.Mpfr.Nativempfr_t
 The result floating-point number.
- op1
- Type: Math.Mpfr.Nativempfr_t
 The first operand floating-point number.
- op2
- Type: SystemDouble
 The second 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
            The IEEE-754 rules are used, in particular for signed zeros.
            But for types having no signed zeros, 0 is considered unsigned
            (i.e., (+0) + 0 = (+0) and (-0) + 0 = (-0)).
            The mpfr_add_d function assumes that the radix of the double type is a power of 2,
            with a precision at most that declared by the C implementation
            (macro IEEE_DBL_MANT_DIG, and if not defined 53 bits). 
            
 Examples
Examples
mpfr_t op1 = new mpfr_t();
mpfr_lib.mpfr_init2(op1, 64U);
Assert.IsTrue(mpfr_lib.mpfr_set_si(op1, 10, mpfr_rnd_t.MPFR_RNDN) == 0);
mpfr_t rop = new mpfr_t();
mpfr_lib.mpfr_init2(rop, 64U);
Assert.IsTrue(mpfr_lib.mpfr_add_d(rop, op1, 210.0, mpfr_rnd_t.MPFR_RNDN) == 0);
Assert.IsTrue(mpfr_lib.mpfr_get_d(rop, mpfr_rnd_t.MPFR_RNDN) == 220.0);
mpfr_lib.mpfr_clears(rop, op1, null);
Dim op1 As mpfr_t = New mpfr_t()
mpfr_lib.mpfr_init2(op1, 64U)
Assert.IsTrue(mpfr_lib.mpfr_set_si(op1, 10, mpfr_rnd_t.MPFR_RNDN) = 0)
Dim rop As mpfr_t = New mpfr_t()
mpfr_lib.mpfr_init2(rop, 64U)
Assert.IsTrue(mpfr_lib.mpfr_add_d(rop, op1, 210.0, mpfr_rnd_t.MPFR_RNDN) = 0)
Assert.IsTrue(mpfr_lib.mpfr_get_d(rop, mpfr_rnd_t.MPFR_RNDN) = 220.0)
mpfr_lib.mpfr_clears(rop, op1, Nothing)
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