Module gmp_mpfr_sys::mpc

source ·
Expand description

Function and type bindings for the MPC library.

Examples

use gmp_mpfr_sys::mpc;
use gmp_mpfr_sys::mpfr;
use std::f64;
use std::mem;
let one_third = 1.0_f64 / 3.0;
let neg_inf = f64::NEG_INFINITY;
unsafe {
    let mut c = mem::uninitialized();
    mpc::init3(&mut c, 53, 53);
    let dirs = mpc::set_d_d(&mut c, one_third, neg_inf, mpc::RNDNN);
    assert_eq!(dirs, 0);
    let re_ptr = mpc::realref_const(&c);
    let re = mpfr::get_d(re_ptr, mpfr::rnd_t::RNDN);
    assert_eq!(re, one_third);
    let im_ptr = mpc::imagref_const(&c);
    let im = mpfr::get_d(im_ptr, mpfr::rnd_t::RNDN);
    assert_eq!(im, neg_inf);
    mpc::clear(&mut c);
}

Structs

Constants

Functions

abs
See: mpc_abs
acos
add
See: mpc_add
arg
See: mpc_arg
asin
atan
cmp
See: mpc_cmp
conj
cos
See: mpc_cos
cosh
div
See: mpc_div
exp
See: mpc_exp
fma
See: mpc_fma
imag
Constant version of imagref.
log
See: mpc_log
mul
See: mpc_mul
neg
See: mpc_neg
norm
pow
See: mpc_pow
proj
real
Constant version of realref.
set
See: mpc_set
sin
See: mpc_sin
sinh
sqr
See: mpc_sqr
sqrt
swap
tan
See: mpc_tan
tanh

Type Definitions