diff --git a/Cargo.toml b/Cargo.toml index d833beb..dc89349 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,6 +22,10 @@ name = "shootout-pidigits" optional = true path = "bigint" +[dependencies.num-complex] +optional = false +path = "complex" + [dependencies.num-integer] path = "./integer" diff --git a/complex/Cargo.toml b/complex/Cargo.toml new file mode 100644 index 0000000..3c719fb --- /dev/null +++ b/complex/Cargo.toml @@ -0,0 +1,10 @@ +[package] +authors = ["Ɓukasz Jan Niemier "] +name = "num-complex" +version = "0.1.0" + +[dependencies] + +[dependencies.num-traits] +optional = false +path = "../traits" diff --git a/src/complex.rs b/complex/src/lib.rs similarity index 99% rename from src/complex.rs rename to complex/src/lib.rs index 8f8cfae..854fb34 100644 --- a/src/complex.rs +++ b/complex/src/lib.rs @@ -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. diff --git a/src/lib.rs b/src/lib.rs index 4fce75d..36723ee 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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;