Commit Graph

31 Commits

Author SHA1 Message Date
Homu 879f2c868e Auto merge of #125 - IvanUkhov:real-arithmetic, r=cuviper
Implement arithmetic with real for complex

Hello,

It might be handy to be able to perform basic arithmetic operations in expressions mixing complex numbers and numeric primitives; see #116. I would be grateful for any feedback, especially regarding the subsets of primitives for which certain operations are implemented.

Regards,
Ivan
2015-11-12 03:03:06 +09:00
Abhishek Chanda 7acad5ac33 Implement some more functions for the complex type 2015-11-05 14:20:37 -08:00
Ivan Ukhov b57e4a4db4 Implement arithmetic with real for complex 2015-10-31 06:38:38 +01:00
Abhishek Chanda e5099930e7 Implement is_nan for the complex type
Also run the associated test
2015-10-30 15:35:04 -07:00
William Rieger c715405b30 Add functions and tests. 2015-09-13 18:19:00 -04:00
William Rieger 50d89519a2 Merge branch 'master' into develop
Conflicts:
	src/complex.rs
2015-09-04 18:56:40 -04:00
William Rieger ff6a40cc88 Remove reduntant Num trait from an impl. 2015-09-04 17:48:31 -04:00
William Rieger 98b9df622f Add mathematical functions for complex numbers.
For Complex<T: Clone + Float>, the following functions along with
corresponding tests were added:
- exp
- sin, cos, tan
- sinh, cosh, tanh
2015-09-04 02:08:31 -04:00
root 4c123a9e71 Make rustc-serialize, bignum, rational, complex into opt-out features
Making bignum optional allows skipping the rustc-serialize and rand
dependencies too, and it makes a big difference in num's build time.

With default (all) features, clean build time including dependencies: 27
seconds.

With no default features, clean build time including dependencies (none):
5 seconds.
2015-06-02 23:48:06 +02:00
Anders Kaseorg 7fb887bffc Require Neg for Complex conj and inv
If T is an unsigned integer type, these methods are guaranteed to
overflow unless the result is actually real, so we should disallow
them for the same reason that Neg was removed from these types.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2015-04-03 15:10:44 -04:00
Aaron Turon 63c7a25ed9 Update to 1.0.0-beta (stable only)
Along the way, this commit also rationalizes the traits a bit more.

Moving to stable required vendoring a couple of minor things (notably,
radix formatting).
2015-04-03 10:17:39 -07:00
Darin Morrison 8ea4c031dd Replace #[should_fail] with #[should_panic] 2015-03-17 22:21:25 -06:00
Alex Crichton c05cd530db Bump to 0.1.10 2015-01-23 08:54:55 -08:00
Huon Wilson 139cf8cf66 Bump to 0.1.7. 2015-01-09 22:36:03 +11:00
Alex Crichton bfa91ee92a Bump to 0.1.6 2015-01-07 12:09:44 -08:00
gifnksm 8219095e39 update to rust mater 2015-01-05 01:59:44 +09:00
Sven Nilsen ae3bb3619c Upgrade to latest Rust
A `_0` test fails, but don’t know why
2015-01-03 19:30:05 +01:00
Alex Crichton 5d4b921537 Fix build warnings 2014-12-23 09:51:08 -08:00
gifnksm 9316be3bc1 update to latest rustc 2014-12-21 19:41:03 +09:00
Chase McCarthy a7e9e79049 Add semicolons to macro lines 2014-12-18 21:01:24 -05:00
gifnksm a325a566c6 update to latest rustc
Now, arithmetic binary operator traits take operands by value,
but non-copyable types such as `BigUint` should not always moved out when
applying operators.

This commit implements these operators not only for bare structs also
these references.
By-value implementations are forwarded to by-reference implementations
for now. In the future, by-value implementations may be replaced with
more efficient implementations (for example, the implementation that
reuses moved buffers.)
2014-12-16 23:44:16 +09:00
gifnksm 1533fe2017 fix deperecation warning 2014-12-09 23:48:37 +09:00
gifnksm d89fbbf044 Add `deriving(Copy)` for `Copy`able structs/enums/ 2014-12-09 23:46:39 +09:00
gifnksm b20dda2307 Update to iter stabilization.
`AdditiveIterator::sum` and `MultiplicativeIterator::product` now take bare self.
2014-11-27 23:06:06 +09:00
gifnksm 2155e7d2ee Add numeric functions and `traits` module that provide numeric traits for generic
mathematcs.

Import numeric traits and functions that were removed from the standard library.
This also implements `AdditiveIterator` and `MultiplicativeIterator` for
`BigUint` and `BigInt`.

closes #28
2014-11-16 19:37:49 +09:00
gifnksm 7a7c5fb2ad Implements `Encodable` and `Decodable`
Fixes #27
2014-11-13 20:54:42 +09:00
gifnksm d3fd33a878 Fix lint name warning 2014-11-05 07:32:00 +09:00
Alex Crichton 6c56fe940c Update to Rust master
Closes #17
2014-10-21 09:27:08 -07:00
gifnksm f1d975b6f1 Migrate to new `cfg` attribute syntax` 2014-10-10 22:56:15 +09:00
gifnksm 2fe050c471 Convert statics to constants 2014-10-10 22:50:22 +09:00
Aaron Turon 482f0e0b74 Initial seeding from rust repo 2014-09-16 10:35:35 -07:00