Module gmp_mpfr_sys::mpc[][src]

Expand description

Function and type bindings for the MPC library.

Examples

use core::{f64, mem::MaybeUninit};
use gmp_mpfr_sys::{mpc, mpfr};
let one_third = 1.0_f64 / 3.0;
let neg_inf = f64::NEG_INFINITY;
unsafe {
    let mut c = MaybeUninit::uninit();
    mpc::init3(c.as_mut_ptr(), 53, 53);
    let mut c = c.assume_init();
    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

See: mpc_abs

See: mpc_acos

See: mpc_acosh

See: mpc_add

See: mpc_arg

See: mpc_asin

See: mpc_asinh

See: mpc_atan

See: mpc_atanh

See: mpc_clear

See: mpc_cmp

See: mpc_conj

See: mpc_cos

See: mpc_cosh

See: mpc_div

See: mpc_dot

See: mpc_exp

See: mpc_fma

See: mpc_imag

Constant version of imagref.

See: mpc_init2

See: mpc_init3

See: mpc_log

See: mpc_log10

See: mpc_mul

See: mpc_mul_i

See: mpc_neg

See: mpc_norm

See: mpc_pow

See: mpc_pow_d

See: mpc_pow_z

See: mpc_proj

See: mpc_real

Constant version of realref.

See: mpc_set

See: mpc_set_d

See: mpc_set_f

See: mpc_set_q

See: mpc_set_z

See: mpc_sin

See: mpc_sinh

See: mpc_sqr

See: mpc_sqrt

See: mpc_sum

See: mpc_swap

See: mpc_tan

See: mpc_tanh

Type Definitions