Skip to content

impl Integer for i128 and u128 #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
language: rust
rust:
- 1.8.0
- 1.15.0
- 1.20.0
- stable
- beta
- nightly
Expand Down
7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@ categories = ["algorithms", "science", "no-std"]
license = "MIT/Apache-2.0"
repository = "https://github.com/rust-num/num-integer"
name = "num-integer"
version = "0.1.36"
version = "0.1.37"
readme = "README.md"

[package.metadata.docs.rs]
all-features = true

[dependencies.num-traits]
version = "0.2.0"
version = "0.2.3"
default-features = false

[features]
default = ["std"]
std = []
i128 = ["num-traits/i128"]
std = ["num-traits/std"]
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ default-features = false
There is no functional difference with and without `std` at this time, but
there may be in the future.

Implementations for `i128` and `u128` are only available when `i128` is enabled.

## Releases

Release notes are available in [RELEASES.md](RELEASES.md).
Expand Down
9 changes: 9 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# Release 0.1.37

- [`Integer` is now implemented for `i128` and `u128`][7] starting with Rust
1.26, enabled by the new `i128` crate feature.

**Contributors**: @cuviper

[7]: https://github.com/rust-num/num-integer/pull/7

# Release 0.1.36

- [num-integer now has its own source repository][num-356] at [rust-num/num-integer][home].
Expand Down
2 changes: 1 addition & 1 deletion ci/rustup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
set -ex

export TRAVIS_RUST_VERSION
for TRAVIS_RUST_VERSION in 1.8.0 stable beta nightly; do
for TRAVIS_RUST_VERSION in 1.8.0 1.15.0 1.20.0 stable beta nightly; do
run="rustup run $TRAVIS_RUST_VERSION"
$run cargo build --verbose
$run $PWD/ci/test_full.sh
Expand Down
6 changes: 6 additions & 0 deletions ci/test_full.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@ cargo test --verbose
# test `no_std`
cargo build --verbose --no-default-features
cargo test --verbose --no-default-features

# test `i128`
if [[ "$TRAVIS_RUST_VERSION" =~ ^(nightly|beta|stable)$ ]]; then
cargo build --verbose --features=i128
cargo test --verbose --features=i128
fi
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,8 @@ impl_integer_for_isize!(i16, test_integer_i16);
impl_integer_for_isize!(i32, test_integer_i32);
impl_integer_for_isize!(i64, test_integer_i64);
impl_integer_for_isize!(isize, test_integer_isize);
#[cfg(feature = "i128")]
impl_integer_for_isize!(i128, test_integer_i128);

macro_rules! impl_integer_for_usize {
($T:ty, $test_mod:ident) => (
Expand Down Expand Up @@ -675,6 +677,8 @@ impl_integer_for_usize!(u16, test_integer_u16);
impl_integer_for_usize!(u32, test_integer_u32);
impl_integer_for_usize!(u64, test_integer_u64);
impl_integer_for_usize!(usize, test_integer_usize);
#[cfg(feature = "i128")]
impl_integer_for_usize!(u128, test_integer_u128);

/// An iterator over binomial coefficients.
pub struct IterBinomial<T> {
Expand Down