Extract complex

This commit is contained in:
Łukasz Jan Niemier 2016-03-11 00:55:53 +01:00
parent 2a67a5b86e
commit ed076070e6
4 changed files with 20 additions and 3 deletions

View File

@ -22,6 +22,10 @@ name = "shootout-pidigits"
optional = true
path = "bigint"
[dependencies.num-complex]
optional = false
path = "complex"
[dependencies.num-integer]
path = "./integer"

10
complex/Cargo.toml Normal file
View File

@ -0,0 +1,10 @@
[package]
authors = ["Łukasz Jan Niemier <lukasz@niemier.pl>"]
name = "num-complex"
version = "0.1.0"
[dependencies]
[dependencies.num-traits]
optional = false
path = "../traits"

View File

@ -8,16 +8,17 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
//! Complex numbers.
extern crate num_traits as traits;
use std::fmt;
use std::ops::{Add, Div, Mul, Neg, Sub};
#[cfg(feature = "serde")]
use serde;
use {Zero, One, Num, Float};
use traits::{Zero, One, Num, Float};
// FIXME #1284: handle complex NaN & infinity etc. This
// probably doesn't map to C's _Complex correctly.

View File

@ -59,6 +59,8 @@
extern crate num_traits;
extern crate num_integer;
#[cfg(feature = "complex")]
extern crate num_complex;
#[cfg(feature = "num-bigint")]
extern crate num_bigint;
#[cfg(feature = "num-rational")]
@ -96,7 +98,7 @@ use std::ops::{Mul};
#[cfg(feature = "num-bigint")]
pub use num_bigint as bigint;
pub mod complex;
pub use num_complex as complex;
pub use num_integer as integers;
pub mod iter;
pub use num_traits as traits;