Commit Graph

583 Commits

Author SHA1 Message Date
Josh Stone ee6bbdb2f6 complex: refactor ParseComplexError a little 2017-07-19 15:16:34 -07:00
Josh Stone bd22a89a32 complex: Simplify the from_str signature 2017-07-19 12:49:03 -07:00
Josh Stone 79c7a4be5f complex: relax the FromStr trait requirements even more 2017-07-19 12:47:07 -07:00
Alan Liddell 16a180f132 simplifies parse loop, allows leading '+', parametrizes Error on T::Err 2017-07-19 06:03:05 -04:00
Alan Liddell add0fbf0f0 More informative error messages for complex::from_str 2017-07-16 15:20:50 -04:00
Alan Liddell 38ee1304bb Cleaned out some allocations 2017-07-16 09:51:55 -04:00
Alan Liddell 97e6d45d03 Adds more tests, including failure cases 2017-07-13 14:50:27 -04:00
Alan Liddell 14d323f5a3 Allows 'j' for imaginary unit 2017-07-13 14:13:04 -04:00
Alan Liddell ac746c2a5d Allows for arbitrary spacing between operands when parsing Complex 2017-07-13 14:05:44 -04:00
Alan Liddell e5e8266009 handles case where imaginary part is just 'i' or '-i', adds tests 2017-07-10 09:51:46 -04:00
Alan Liddell 506fbaf4e7 swap 'Some(u)' out for '_' to suppress unused variable warnings 2017-07-10 08:09:49 -04:00
Alan Liddell 3c490cdee4 adds basic parser for complex numbers in Cartesian form 2017-07-10 05:57:38 -04:00
Josh Stone 31fa9f626a Merge pull request #316 from cuviper/bors-ng
Enable bors-ng
2017-07-08 22:51:41 -07:00
Josh Stone b181cae401 Enable bors-ng 2017-07-08 22:29:48 -07:00
Josh Stone 3299702e69 Whitelist branches for CI 2017-07-08 22:28:49 -07:00
Josh Stone 8964c65f38 bigint: apply a consistent order of conversion methods 2017-06-21 17:52:24 -07:00
Josh Stone 8dd6890ddc Merge commit 'refs/pull/304/head' of github.com:rust-num/num 2017-06-21 17:33:46 -07:00
Eduardo Pinho 15f9334955 De-generalize `twos_complement' helper function 2017-06-20 01:31:49 +01:00
Eduardo Pinho 61cfdc37b3 BigInt two's complement adjustments
- rename `_twos_complement_` methods to just `_signed_`
- make `from_` variants take &[u8]
- refactor helper functions twos_complement (they take byte slice but use a generic function underneath)
- fix issues in `to_signed_` functions (only two's complement negative numbers; perform byte extension where needed)
- add tests to `to_signed_` methods
2017-06-18 01:42:56 +01:00
Phaiax 563e4dc509 from_radix_be/le for BigInt 2017-06-16 23:28:49 +02:00
Eduardo Pinho 1660590125 Add BigInt 2's complement conversions
- add methods `from_twos_complement_bytes_le`, `from_twos_complement_bytes_be`, `to_twos_complement_bytes_le`, and `to_twos_complement_bytes_be` to `BigInt`.
- add respective tests
2017-06-16 17:58:04 +01:00
Phaiax 1ea02d8d0c Add _be/_le postfix to from/to_radix functions (BigInt) 2017-06-13 15:36:59 +02:00
Phaiax fc09503d3d Add fn from_radix() for radix > 36. 2017-06-11 20:08:43 +02:00
Phaiax 1ab07df709 Add fn to_radix() for radix > 36. 2017-06-11 18:31:44 +02:00
Josh Stone b1b034f438 num: bump to 0.1.39 2017-06-09 11:03:50 -07:00
Josh Stone d2defd67f2 bigint: bump to 0.1.39 2017-06-09 11:02:16 -07:00
Josh Stone 81e932b671 rational: bump to 0.1.38 2017-06-09 10:58:40 -07:00
Josh Stone 796adf5dfa traits: bump to 0.1.39 2017-06-09 10:56:13 -07:00
Homu 5cd52741c4 Auto merge of #301 - cuviper:revert-296, r=cuviper
Revert "Auto merge of #296 - vks:no_std, r=cuviper"

This reverts commit 8b5d4ac24e, reversing
changes made to ef752e4687.

See #297 -- it's a breaking change to feature-gate existing APIs.
2017-06-10 02:26:53 +09:00
Josh Stone fe34d17aaf Revert "Auto merge of #296 - vks:no_std, r=cuviper"
This reverts commit 8b5d4ac24e, reversing
changes made to ef752e4687.
2017-06-09 10:12:50 -07:00
Homu 681bbf8659 Auto merge of #300 - cuviper:no-default-subcrates, r=cuviper
Test and fix subcrates with --no-default-features

- The CI script now tests them all with --no-default-features.
- bigint: testing needs rand even when the main feature is disabled.
- rational: gate `FromPrimitive for Ratio<BigInt>` on having bigint.
2017-06-10 02:00:14 +09:00
Josh Stone 8b9cdaada2 Test and fix subcrates with --no-default-features
- The CI script now tests them all with --no-default-features.
- bigint: testing needs rand even when the main feature is disabled.
- rational: gate `FromPrimitive for Ratio<BigInt>` on having bigint.
2017-06-09 09:54:50 -07:00
Homu f809c79d9f Auto merge of #299 - dotdash:rational-fix, r=cuviper
Fix building without the num-bigint feature
2017-06-10 01:54:07 +09:00
Björn Steinbrink 33ca084e85 Fix building without the num-bigint feature 2017-06-09 18:45:44 +02:00
Josh Stone 7bf9a6ccf2 num: bump to 0.1.38 2017-06-08 23:53:47 -07:00
Josh Stone 1033388e02 rational: bump to 0.1.37 2017-06-08 23:50:30 -07:00
Josh Stone a6d4d6e67d bigint: bump to 0.1.38 2017-06-08 23:48:27 -07:00
Josh Stone 9a9765a1db complex: bump to 0.1.38 2017-06-08 23:46:08 -07:00
Josh Stone ae438d3608 traits: bump to 0.1.38 2017-06-08 23:42:41 -07:00
Homu 8b5d4ac24e Auto merge of #296 - vks:no_std, r=cuviper
traits: Introduce std feature

This makes it possible to build `traits` without `std`. For this a new
trait `BasicFloat` was introduced, implementing some basic functionality
that works with `core`. Most notably this is lacking functions like
`cos`, `sin`, etc.

`Float` is not available without `std`.

Refs #216.
2017-06-09 15:25:08 +09:00
Vinzent Steinberg ba73ba2af0 Avoid infinite recursion on `no_std` 2017-06-08 10:02:39 +02:00
Vinzent Steinberg b7d2a99d09 Add word of caution about `Float` and `no_std` 2017-06-07 12:22:26 +02:00
Vinzent Steinberg 63ce0f04ae Don't duplicate `num_traits::pow` 2017-06-07 12:17:16 +02:00
Vinzent Steinberg f8a61962ba Use native `to_degrees`/`to_radians` 2017-06-07 12:05:53 +02:00
Vinzent Steinberg d201882c61 Fix typo 2017-06-07 11:59:28 +02:00
Vinzent Steinberg 128e456342 Travis, please test traits with no_std 2017-06-02 12:01:31 +02:00
Vinzent Steinberg 169105bb84 Implement `Float::{min, max}` for `no_std` 2017-06-02 11:47:46 +02:00
Vinzent Steinberg 6253669ef4 Mark methods in `Float` whether they require `std`
This removes the `BasicFloat` trait.
2017-06-02 11:47:45 +02:00
Vinzent Steinberg 351dfc6383 traits: Introduce std feature
This makes it possible to build `traits` without `std`. For this a new
trait `BasicFloat` was introduced, implementing some basic functionality
that works with `core`. Most notably this is lacking functions like
`cos`, `sin`, etc.

`Float` is not available without `std`.

Refs #216.
2017-05-31 13:44:39 +02:00
Homu ef752e4687 Auto merge of #291 - cuviper:hasher, r=cuviper
Get the default hasher indirectly

`DefaultHasher` wasn't stable until 1.13, at which point all the other
hashers were deprecated, so it's not easy for us to name a hasher type to
use for testing.  However, `RandomState` has been stable since 1.7, and it
implements `BuildHasher` that has a `Hasher` associated type.

(extends #287)
2017-05-07 14:48:07 +09:00