1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// Copyright © 2016–2017 University of Malta

// This program is free software: you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License and a copy of the GNU General Public License along with
// this program. If not, see <http://www.gnu.org/licenses/>.

//! # Multiple-precision complex numbers
//!
//! The `rugcom` crate provides multiple-precision complex numbers
//! using [GNU MPC](http://www.multiprecision.org/), a library for the
//! arithmetic of complex numbers with arbitrarily high precision and
//! correct rounding of the result. It can be helpful to refer to the
//! documentation at the
//! [MPC](http://www.multiprecision.org/index.php?prog=mpc&page=html)
//! page.
//!
//! This crate is free software: you can redistribute it and/or modify
//! it under the terms of the GNU Lesser General Public License as
//! published by the Free Software Foundation, either version 3 of the
//! License, or (at your option) any later version.
//!
//! This crate is one of a group of four crates:
//!
//!   * [`rugint`](../rugint/index.html) for arbitrary-precision
//!     integers,
//!   * [`rugrat`](../rugrat/index.html) for arbitrary-precision
//!     rational numbers,
//!   * [`rugflo`](../rugflo/index.html) for multiple-precision
//!     floating-point numbers, and
//!   * [`rugcom`](../rugcom/index.html) for multiple-precision
//!     complex numbers.
//!
//! # Basic use
//!
//! The crate provides the [`Complex`](./struct.Complex.html) type, which
//! holds a multiple-precision complex number.
//!
//! ## Examples
//!
//! ```rust
//! extern crate rugint;
//! extern crate rugcom;
//! use rugint::Assign;
//! use rugcom::Complex;
//!
//! fn main() {
//!     // Create complex number with 16 bits of precision.
//!     let mut com = Complex::new((16, 16));
//!     com.assign((1.5, 3.5));
//!     assert!(*com.real() == 1.5);
//!     assert!(*com.imag() == 3.5);
//! }
//! ```

extern crate gmp_mpfr_sys;
#[cfg(feature = "rand")]
extern crate rand;
extern crate rugint;
extern crate rugrat;
extern crate rugflo;

mod complex;

pub use complex::{Complex, Ordering2, Prec2, Round2};