Bump to 0.1.6

This commit is contained in:
Alex Crichton 2015-01-07 12:09:44 -08:00
parent 431dd18aff
commit bfa91ee92a
5 changed files with 4 additions and 77 deletions

View File

@ -1,7 +1,7 @@
[package]
name = "num"
version = "0.1.5"
version = "0.1.6"
authors = ["The Rust Project Developers"]
license = "MIT/Apache-2.0"
homepage = "https://github.com/rust-lang/num"

View File

@ -59,7 +59,6 @@ use Integer;
use std::default::Default;
use std::iter::repeat;
use std::iter::{AdditiveIterator, MultiplicativeIterator};
use std::num::FromStrRadix;
use std::num::{Int, ToPrimitive, FromPrimitive};
use std::ops::{Add, BitAnd, BitOr, BitXor, Div, Mul, Neg, Rem, Shl, Shr, Sub};
@ -852,20 +851,6 @@ impl FromStrRadix for BigUint {
}
}
impl<T: Iterator<Item = BigUint>> AdditiveIterator<BigUint> for T {
fn sum(self) -> BigUint {
let init: BigUint = Zero::zero();
self.fold(init, |acc, x| acc + x)
}
}
impl<T: Iterator<Item = BigUint>> MultiplicativeIterator<BigUint> for T {
fn product(self) -> BigUint {
let init: BigUint = One::one();
self.fold(init, |acc, x| acc * x)
}
}
impl BigUint {
/// Creates and initializes a `BigUint`.
///
@ -1554,20 +1539,6 @@ impl<R: Rng> RandBigInt for R {
}
}
impl<T: Iterator<Item = BigInt>> AdditiveIterator<BigInt> for T {
fn sum(self) -> BigInt {
let init: BigInt = Zero::zero();
self.fold(init, |acc, x| acc + x)
}
}
impl<T: Iterator<Item = BigInt>> MultiplicativeIterator<BigInt> for T {
fn product(self) -> BigInt {
let init: BigInt = One::one();
self.fold(init, |acc, x| acc * x)
}
}
impl BigInt {
/// Creates and initializes a BigInt.
///

View File

@ -12,8 +12,7 @@
//! Complex numbers.
use std::fmt;
use std::num::FloatMath;
use std::iter::{AdditiveIterator, MultiplicativeIterator};
use std::num::Float;
use std::ops::{Add, Div, Mul, Neg, Sub};
use {Zero, One, Num};
@ -76,7 +75,7 @@ impl<T: Clone + Num> Complex<T> {
}
}
impl<T: Clone + FloatMath> Complex<T> {
impl<T: Clone + Float> Complex<T> {
/// Calculate |self|
#[inline]
pub fn norm(&self) -> T {
@ -84,7 +83,7 @@ impl<T: Clone + FloatMath> Complex<T> {
}
}
impl<T: Clone + FloatMath + Num> Complex<T> {
impl<T: Clone + Float + Num> Complex<T> {
/// Calculate the principal Arg of self.
#[inline]
pub fn arg(&self) -> T {
@ -252,24 +251,6 @@ impl<T: fmt::Show + Num + PartialOrd + Clone> fmt::Show for Complex<T> {
}
}
impl<A, T> AdditiveIterator<Complex<A>> for T
where A: Clone + Num, T: Iterator<Item = Complex<A>>
{
fn sum(self) -> Complex<A> {
let init: Complex<A> = Zero::zero();
self.fold(init, |acc, x| acc + x)
}
}
impl<A, T> MultiplicativeIterator<Complex<A>> for T
where A: Clone + Num, T: Iterator<Item = Complex<A>>
{
fn product(self) -> Complex<A> {
let init: Complex<A> = One::one();
self.fold(init, |acc, x| acc * x)
}
}
#[cfg(test)]
mod test {
#![allow(non_upper_case_globals)]

View File

@ -1,5 +1,3 @@
#![feature(old_orphan_check)]
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
@ -45,9 +43,6 @@
//!
//! [newt]: https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method
#![feature(associated_types)]
#![feature(macro_rules)]
#![feature(default_type_params)]
#![feature(slicing_syntax)]
#![cfg_attr(test, deny(warnings))]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",

View File

@ -17,7 +17,6 @@ use std::fmt;
use std::ops::{Add, Div, Mul, Neg, Rem, Sub};
use std::str::FromStr;
use std::num::{FromPrimitive, FromStrRadix, Float};
use std::iter::{AdditiveIterator, MultiplicativeIterator};
use bigint::{BigInt, BigUint, Sign};
use {Num, Signed, Zero, One};
@ -456,25 +455,6 @@ impl<T: FromStrRadix + Clone + Integer + PartialOrd>
}
}
impl<A, T> AdditiveIterator<Ratio<A>> for T
where A: Clone + Integer + PartialOrd, T: Iterator<Item = Ratio<A>>
{
fn sum(self) -> Ratio<A> {
let init: Ratio<A> = Zero::zero();
self.fold(init, |acc, x| acc + x)
}
}
impl<A, T> MultiplicativeIterator<Ratio<A>> for T
where A: Clone + Integer + PartialOrd, T: Iterator<Item = Ratio<A>>
{
fn product(self) -> Ratio<A> {
let init: Ratio<A> = One::one();
self.fold(init, |acc, x| acc * x)
}
}
#[cfg(test)]
mod test {