Commit Graph

899 Commits

Author SHA1 Message Date
Josh Stone 6513a5618b num-integer-0.1.34 2017-04-09 06:22:05 -07:00
Josh Stone fca95eaf42 num-complex-0.1.37 2017-04-09 06:18:09 -07:00
Homu aff06286ad Auto merge of #275 - bluss:repr-c, r=cuviper
Complex: Use repr(C) and add documentation for what it means

Here's an ambitious proposal that puts currently practiced ffi usage of `Complex<f32/f64>` on sound footing.

Fixes  #79

Current users appear to be:

- https://crates.io/crates/blas
  + Their use is not about Complex<f64> in an extern function's signature, but it is explicitly using that it is memory layout compatible.
2017-04-05 01:53:14 +09:00
bluss 0cf3419b9e complex: Use repr(C) and add documentation for what it means 2017-04-04 06:48:35 +02:00
Homu f63c933737 Auto merge of #272 - vks:binomial-coeffs, r=cuviper
Implement an iterator over the binomial coefficients

I'm not very happy with the excessive cloning, but to fix it the bounds on the type parameters would have to be excessive. We probably need something like [this](https://github.com/vks/discrete-log/blob/master/src/main.rs#L90) in `num-traits`.
2017-03-31 10:29:14 +09:00
Vinzent Steinberg 0fc6cb15a5 binomial: Discuss overflow 2017-03-29 14:13:39 +02:00
Vinzent Steinberg a7b459c05e Make `binomial` and `IterBinomial` less likely to overflow 2017-03-26 15:57:25 +02:00
Homu 4fc1e28832 Auto merge of #271 - vks:multinomial, r=cuviper
Implement multinomial
2017-03-26 04:40:20 +09:00
Homu 904d9b494f Auto merge of #170 - DonSheddow:complex-fmt, r=cuviper
Add formatting options for Complex

This adds LowerExp and UpperExp traits for Complex, taking precision into account. Fixes #148
2017-03-26 04:31:24 +09:00
Sigurd Kolltveit 2784b89837 Remove support for zero padding 2017-03-20 19:04:17 +01:00
Vinzent Steinberg d4deba6947 IterBinomial: Make tests closer to overflow threshold (like for binomial) 2017-03-20 10:45:27 +01:00
Vinzent Steinberg 47613ff5ff IterBinomial: Only return coefficient 2017-03-20 10:20:15 +01:00
Vinzent Steinberg e486e6a981 Address some of @cuviper's feedback 2017-03-20 10:14:01 +01:00
Vinzent Steinberg 3de345f912 Don't panic when calculating multinomial 2017-03-20 09:43:01 +01:00
Sigurd Kolltveit e044cfbc6d Simplify some lines 2017-03-18 17:24:00 +01:00
Sigurd Kolltveit 69943915ba Add more string formatting tests 2017-03-18 16:04:53 +01:00
Sigurd Kolltveit e2759e0321 Implement more formatting options for Complex 2017-03-18 16:04:53 +01:00
Sigurd Kolltveit 6113192e04 Add tests for more formatting options 2017-03-18 16:04:53 +01:00
Sigurd Kolltveit f138f3da9e Add formatting options for Complex 2017-03-18 16:04:53 +01:00
Vinzent Steinberg c408bd6605 Try to fix build on Rust 1.8 2017-03-17 18:21:06 +01:00
Vinzent Steinberg 8d235759dd Implement an iterator over the binomial coefficients 2017-03-17 18:03:58 +01:00
Vinzent Steinberg ebe3f85976 Implement multinomial 2017-03-17 17:27:46 +01:00
Homu 2adf018aa6 Auto merge of #270 - vks:binomial, r=cuviper
Implement binomial

The implementation avoids overflows and fractions.
2017-03-16 08:55:20 +09:00
Vinzent Steinberg 40cbe1ff20 Use correct formula 2017-03-12 10:23:27 +01:00
Vinzent Steinberg 07df43b034 Address binomial review feedback
* Use substraction instead of division in comparison.
* More tests.
* Add comment.
2017-03-12 10:17:49 +01:00
Vinzent Steinberg 2f6eb31903 Implement binomial
The implementation avoids overflows and fractions.
2017-03-11 16:44:51 +01:00
Josh Stone d23e3f32b8 num-bigint-0.1.37 2017-03-08 11:14:32 -08:00
Homu fe21c725e8 Auto merge of #269 - cuviper:biguint-parse-plus, r=cuviper
bigint: Create the parsing error better for nested `+`

If a `+` is encountered in the middle of parsing a BigUint, this should
generate an `ParseIntError::InvalidDigit`.  Since we can't create that
directly, we get it by trying to parse a `u64` from this point, but of
course `+` is a perfectly valid prefix to a `u64`.

Now we include the previous character in the string passed to `u64`, so it
has proper parsing context to understand what's in error.

Fixes #268.
2017-03-09 04:10:48 +09:00
Josh Stone 0b6cae0dc7 bigint: Create the parsing error better for nested `+`
If a `+` is encountered in the middle of parsing a BigUint, this should
generate an `ParseIntError::InvalidDigit`.  Since we can't create that
directly, we get it by trying to parse a `u64` from this point, but of
course `+` is a perfectly valid prefix to a `u64`.

Now we include the previous character in the string passed to `u64`, so
it has proper parsing context to understand what's in error.

Fixes #268.
2017-03-06 13:23:40 -08:00
Josh Stone 4b8c71fbec bigint: Cleanup unused imports 2017-03-06 13:20:30 -08:00
Josh Stone 66ce252494 Bump versions in the num collection 2017-02-26 14:18:33 -08:00
Josh Stone 6632ca8e1b Merge pull request #267 from cuviper/licenses
Add licenses to subcrates
2017-02-26 13:53:29 -08:00
Josh Stone 1a66ee9e80 Add licenses to subcrates 2017-02-26 13:39:23 -08:00
Homu d273495cbf Auto merge of #263 - cuviper:revamp-ci, r=hauleth
Bump rustc to 1.8 and revamp all CI

This bumps the minimum rustc to 1.8.0, "fixing" #257.  I normally
consider this a breaking change, but we were already broken due to
external factors, for which I couldn't find a workaround.

This adds 1.15.0 to the CI matrix to build stable num-derive.  We still
need nightly to run its tests though, because of compiletest_rs, and
dev-dependencies can't be optional.

The testing scripts are moved from .travis/ to ci/, as they don't really
need to be hidden.  It's also now consolidated into one test_full.sh
which considers $TRAVIS_RUST_VERSION as needed.
2017-02-10 09:19:34 +09:00
Josh Stone 1606fe7206 Bump rustc to 1.8 and revamp all CI
This bumps the minimum rustc to 1.8.0, "fixing" #257.  I normally
consider this a breaking change, but we were already broken due to
external factors, for which I couldn't find a workaround.

This adds 1.15.0 to the CI matrix to build stable num-derive.  We still
need nightly to run its tests though, because of compiletest_rs, and
dev-dependencies can't be optional.

The testing scripts are moved from .travis/ to ci/, as they don't really
need to be hidden.  It's also now consolidated into one test_full.sh
which considers $TRAVIS_RUST_VERSION as needed.
2017-02-09 16:09:48 -08:00
Josh Stone d561e4b702 Merge pull request #262 from Xaeroxe23/master
Add clamp function
2017-02-09 14:17:14 -08:00
Jacob Kiesel c78a48fd35 Improve documentation comments
Remove passive voice from documentation comments.
2017-02-08 15:10:01 -07:00
Jacob Kiesel 17665ec50d Update lib.rs
Make assert debug error more accurate.
2017-02-07 15:03:00 -07:00
Jacob Kiesel f8dcec366b Made requested changes. 2017-02-07 13:02:32 -07:00
Jacob Kiesel 182e08a091 Add inline attribute 2017-02-07 10:49:28 -07:00
Jacob Kiesel b346f9c2df Add a new line for improved formatting. 2017-02-07 10:18:23 -07:00
Jacob Kiesel a5445b7619 Adding documentation comments 2017-02-07 10:18:23 -07:00
Jacob Kiesel 07ff5b62b9 Changing to >= and <= as it's a slight optimization 2017-02-07 09:52:23 -07:00
Jacob Kiesel 28633b7e6d Add clamp function 2017-02-07 09:48:34 -07:00
Josh Stone 817ab00f64 Merge pull request #256 from nwin/add-wrapping-traits
Added traits for wrapping arithmetics.
2017-02-04 21:47:53 -08:00
nwin 58b7da46d2 Added tests. 2017-02-04 10:42:12 +01:00
Josh Stone ba54797d60 Merge pull request #258 from frewsxcv/patch-1
Add doc example for `num_traits::Num::from_str_radix`.
2017-01-31 09:37:30 -08:00
Corey Farwell 19109883de Add doc example for `num_traits::Num::from_str_radix`. 2017-01-30 23:42:27 -05:00
nwin 450c0e2760 Correct typos. 2017-01-26 21:12:27 +01:00
nwin ee9d474243 Ensure compatibility with Rust 1.0.0. 2017-01-22 10:13:50 +01:00