|
@@ -57,15 +57,15 @@
|
|
|
html_root_url = "http://rust-num.github.io/num/",
|
|
|
html_playground_url = "http://play.rust-lang.org/")]
|
|
|
|
|
|
-pub extern crate num_traits;
|
|
|
-pub extern crate num_integer;
|
|
|
-pub extern crate num_iter;
|
|
|
+extern crate num_traits;
|
|
|
+extern crate num_integer;
|
|
|
+extern crate num_iter;
|
|
|
#[cfg(feature = "num-complex")]
|
|
|
-pub extern crate num_complex;
|
|
|
+extern crate num_complex;
|
|
|
#[cfg(feature = "num-bigint")]
|
|
|
-pub extern crate num_bigint;
|
|
|
+extern crate num_bigint;
|
|
|
#[cfg(feature = "num-rational")]
|
|
|
-pub extern crate num_rational;
|
|
|
+extern crate num_rational;
|
|
|
|
|
|
#[cfg(feature = "num-bigint")]
|
|
|
pub use num_bigint::{BigInt, BigUint};
|
|
@@ -84,14 +84,31 @@ pub use num_traits::{Num, Zero, One, Signed, Unsigned, Bounded,
|
|
|
use std::ops::{Mul};
|
|
|
|
|
|
#[cfg(feature = "num-bigint")]
|
|
|
-pub use num_bigint as bigint;
|
|
|
+pub mod bigint {
|
|
|
+ pub use num_bigint::*;
|
|
|
+}
|
|
|
+
|
|
|
#[cfg(feature = "num-complex")]
|
|
|
-pub use num_complex as complex;
|
|
|
-pub use num_integer as integer;
|
|
|
-pub use num_iter as iter;
|
|
|
-pub use num_traits as traits;
|
|
|
+pub mod complex {
|
|
|
+ pub use num_complex::*;
|
|
|
+}
|
|
|
+
|
|
|
+pub mod integer {
|
|
|
+ pub use num_integer::*;
|
|
|
+}
|
|
|
+
|
|
|
+pub mod iter {
|
|
|
+ pub use num_iter::*;
|
|
|
+}
|
|
|
+
|
|
|
+pub mod traits {
|
|
|
+ pub use num_traits::*;
|
|
|
+}
|
|
|
+
|
|
|
#[cfg(feature = "num-rational")]
|
|
|
-pub use num_rational as rational;
|
|
|
+pub mod rational {
|
|
|
+ pub use num_rational::*;
|
|
|
+}
|
|
|
|
|
|
/// Returns the additive identity, `0`.
|
|
|
#[inline(always)] pub fn zero<T: Zero>() -> T { Zero::zero() }
|