Skip to content

Commit

Permalink
Move num-bigint to its own repo
Browse files Browse the repository at this point in the history
All the prior `num` history is kept, so old `num-bigint` tags are still
valid, but future development here will be just for `num-bigint`.
  • Loading branch information
cuviper committed Dec 17, 2017
1 parent f172ef3 commit 6a41eaa
Show file tree
Hide file tree
Showing 68 changed files with 168 additions and 10,585 deletions.
8 changes: 1 addition & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: rust
rust:
- 1.15.0
- stable
- beta
- nightly
matrix:
Expand All @@ -14,12 +14,6 @@ sudo: false
script:
- cargo build --verbose
- ./ci/test_full.sh
- cargo doc
after_success: |
[ $TRAVIS_BRANCH = master ] &&
[ $TRAVIS_PULL_REQUEST = false ] &&
[ $TRAVIS_RUST_VERSION = nightly ] &&
ssh-agent ./ci/deploy.sh
notifications:
email:
on_success: never
Expand Down
73 changes: 19 additions & 54 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,73 +1,38 @@
[package]
authors = ["The Rust Project Developers"]
description = "A collection of numeric types and traits for Rust, including bigint,\ncomplex, rational, range iterators, generic integers, and more!\n"
documentation = "http://rust-num.github.io/num"
homepage = "https://github.com/rust-num/num"
description = "Big integer implementation for Rust"
documentation = "https://docs.rs/num-bigint"
homepage = "https://github.com/rust-num/num-bigint"
keywords = ["mathematics", "numerics", "bignum"]
categories = [ "algorithms", "data-structures", "science" ]
license = "MIT/Apache-2.0"
repository = "https://github.com/rust-num/num"
name = "num"
name = "num-bigint"
repository = "https://github.com/rust-num/num-bigint"
version = "0.1.41"

[badges]
travis-ci = { repository = "rust-num/num" }

[[bench]]
name = "bigint"

[[bench]]
harness = false
name = "shootout-pidigits"
readme = "README.md"

[dependencies]

[dependencies.num-bigint]
optional = true
path = "bigint"
version = "0.1.41"

[dependencies.num-complex]
optional = true
path = "complex"
version = "0.1.41"

[dependencies.num-integer]
path = "./integer"
version = "0.1.35"
version = "0.1.32"

[dependencies.num-iter]
optional = false
path = "iter"
version = "0.1.34"
[dependencies.num-traits]
version = "0.1.32"

[dependencies.num-rational]
[dependencies.rand]
optional = true
path = "rational"
version = "0.1.40"
version = "0.3.14"

[dependencies.num-traits]
path = "./traits"
version = "0.1.41"
[dependencies.rustc-serialize]
optional = true
version = "0.3.19"

[dev-dependencies]
[dependencies.serde]
optional = true
version = ">= 0.7.0, < 0.9.0"

[dev-dependencies.rand]
version = "0.3.8"
version = "0.3.14"

[features]
bigint = ["num-bigint"]
complex = ["num-complex"]
rational = ["num-rational"]
default = ["bigint", "complex", "rational", "rustc-serialize"]

serde = [
"num-bigint/serde",
"num-complex/serde",
"num-rational/serde"
]
rustc-serialize = [
"num-bigint/rustc-serialize",
"num-complex/rustc-serialize",
"num-rational/rustc-serialize"
]
default = ["rand", "rustc-serialize"]
21 changes: 8 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,26 @@
# num
# num-bigint

[![](https://travis-ci.org/rust-num/num.svg)](https://travis-ci.org/rust-num/num)
[![crate](https://img.shields.io/crates/v/num-bigint.svg)](https://crates.io/crates/num-bigint)
[![documentation](https://docs.rs/num-bigint/badge.svg)](https://docs.rs/num-bigint)
[![Travis status](https://travis-ci.org/rust-num/num-bigint.svg?branch=master)](https://travis-ci.org/rust-num/num-bigint)

A collection of numeric types and traits for Rust.

This includes new types for big integers, rationals, and complex numbers,
new traits for generic programming on numeric properties like `Integer`,
and generic range iterators.

[Documentation](http://rust-num.github.io/num)
Big integer types for Rust, `BigInt` and `BigUint`.

## Usage

Add this to your `Cargo.toml`:

```toml
[dependencies]
num = "0.1"
num-bigint = "0.1"
```

and this to your crate root:

```rust
extern crate num;
extern crate num_bigint;
```

## Compatibility

Most of the `num` crates are tested for rustc 1.8 and greater.
The exception is `num-derive` which requires at least rustc 1.15.
The `num-bigint` crate is tested for rustc 1.8 and greater.
10 changes: 5 additions & 5 deletions benches/bigint.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#![feature(test)]

extern crate test;
extern crate num;
extern crate num_bigint;
extern crate num_traits;
extern crate rand;

use std::mem::replace;
use test::Bencher;
use num::{BigInt, BigUint, Zero, One, FromPrimitive, Num};
use num::bigint::RandBigInt;
use num_bigint::{BigInt, BigUint, RandBigInt};
use num_traits::{Zero, One, FromPrimitive, Num};
use rand::{SeedableRng, StdRng};

fn get_rng() -> StdRng {
Expand Down Expand Up @@ -177,7 +178,6 @@ fn to_str_radix_36(b: &mut Bencher) {
}

fn from_str_radix_bench(b: &mut Bencher, radix: u32) {
use num::Num;
let mut rng = get_rng();
let x = rng.gen_bigint(1009);
let s = x.to_str_radix(radix);
Expand Down Expand Up @@ -250,7 +250,7 @@ fn pow_bench(b: &mut Bencher) {
for i in 2..upper + 1 {
for j in 2..upper + 1 {
let i_big = BigUint::from_usize(i).unwrap();
num::pow(i_big, j);
num_traits::pow(i_big, j);
}
}
});
Expand Down
9 changes: 6 additions & 3 deletions benches/shootout-pidigits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,16 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
// OF THE POSSIBILITY OF SUCH DAMAGE.

extern crate num;
extern crate num_bigint;
extern crate num_integer;
extern crate num_traits;

use std::str::FromStr;
use std::io;

use num::traits::{FromPrimitive, ToPrimitive};
use num::{BigInt, Integer, One, Zero};
use num_bigint::BigInt;
use num_integer::Integer;
use num_traits::{FromPrimitive, ToPrimitive, One, Zero};

struct Context {
numer: BigInt,
Expand Down
39 changes: 0 additions & 39 deletions bigint/Cargo.toml

This file was deleted.

Loading

0 comments on commit 6a41eaa

Please sign in to comment.