Commit Graph

210 Commits

Author SHA1 Message Date
Abhishek Chanda e5099930e7 Implement is_nan for the complex type
Also run the associated test
2015-10-30 15:35:04 -07:00
Josh Stone 49237f6f45 integer: expand tests for gcd min_value()
- Use explicit asserts for should-panic tests, since overflow is not
  checked in release mode.
- Add positive tests where gcd min_value() can be represented.
- In all cases, test min_value() in both positions.

Closes #127
2015-10-30 00:40:21 -07:00
Josh Stone 642787fbd2 Merge pull request #121 from wrieger93/issue_120
Add a function that returns the sign of a BigInt.
2015-10-27 12:13:17 -07:00
Josh Stone 28209688ab num-macros: VariantData no longer needs to be dereferenced 2015-10-27 11:51:35 -07:00
Josh Stone fe99867590 num-macros: port from ast::VariantKind to ast::VariantData 2015-10-23 10:49:01 -07:00
Josh Stone 9e5a209dcd Merge pull request #123 from murarth/ratio-parse-fix
Check for zero denominator when parsing Ratio
2015-10-23 10:23:18 -07:00
Josh Stone 1666d1bb04 Merge pull request #124 from dripton/master
Remove extra parentheses to fix a warning
2015-10-19 09:57:40 -07:00
David Ripton f53f62737c Merge pull request #1 from dripton/dripton-extra-parens
Remove extra parentheses to fix a warning
2015-10-19 09:48:53 -04:00
David Ripton e86913924e Remove extra parentheses to fix a warning
Removing extra parentheses in a for loop fixes this warning:

src/bigint.rs:1636:18: 1636:31 warning: unnecessary parentheses around `for` head expression, #[warn(unused_parens)] on by default
2015-10-19 09:43:47 -04:00
Murarth b2767517f4 Check for zero denominator when parsing Ratio
Closes #122
2015-10-16 13:10:16 -07:00
Łukasz Niemier 2e4afbc9ba Merge pull request #112 from Emerentius/master
Implement Stein's algorithm for gcd
2015-10-15 13:25:33 +02:00
Łukasz Niemier a786adb874 Merge pull request #115 from wrieger93/complex_functions
Add mathematical functions for complex numbers.
2015-10-15 13:24:39 +02:00
William Rieger 1eb3deaca8 Add a function that returns the sign of a BigInt. 2015-10-06 00:32:32 -07:00
William Rieger c715405b30 Add functions and tests. 2015-09-13 18:19:00 -04:00
Emerentius 499def9207 Added tests for gcd
compare gcd with euclidean gcd
test panics on gcd(min_val, min_val) and gcd(min_val, 0) for signed integers
2015-09-11 20:33:39 +02:00
Emerentius 59089d9d5c Made it panic on gcd = min_val in debug mode
The additional call to .abs() causes a panic on the min value. There are
no other negative values it can encounter.
Does nothing in release mode
2015-09-11 20:27:06 +02:00
Emerentius 82a6ab2f30 comment corrected
referenced a,b, which aren't defined
changed to n,m
2015-09-07 16:50:58 +02:00
Emerentius e892054813 implement Stein's algorithm for gcd 2015-09-07 03:15:16 +02:00
William Rieger 50d89519a2 Merge branch 'master' into develop
Conflicts:
	src/complex.rs
2015-09-04 18:56:40 -04:00
William Rieger fde6c479a6 Merge pull request #1 from rust-lang/master
Update fork.
2015-09-04 18:36:57 -04:00
Alex Crichton 85b9ac58bf Merge pull request #110 from wrieger93/remove_reduntant_trait
Remove reduntant Num trait from an impl.
2015-09-04 15:20:43 -07: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
Alex Crichton 1e07193480 Merge pull request #109 from jdm/rustup
Upgrade to 2015-08-30 rustc nightly.
2015-09-01 14:33:25 -07:00
Josh Matthews 11b9dd0b7a Upgrade to 2015-08-30 rustc nightly. 2015-09-01 16:12:02 -04:00
Huon Wilson 4d7cb95740 Bump to 0.1.27. 2015-08-19 10:15:50 -07:00
Huon Wilson 13bf6a011f Merge pull request #108 from Gustorn/sized
Added Sized trait bound for traits that requite it
2015-08-19 10:13:46 -07:00
Gustorn 3ccb4bd6c5 Added Sized trait bound for traits that requite it
See rust-lang/rfcs#1214
2015-08-19 19:11:55 +02:00
Alex Crichton 1f298e233c Bump versions to 0.1.26 2015-08-10 12:12:08 -07:00
Alex Crichton b57accf314 Update to rust nightly 2015-08-10 12:11:56 -07:00
Alex Crichton d4e7a6654f Bump num to 0.1.25 2015-06-02 16:52:31 -07:00
Alex Crichton a7c70adf5b Merge pull request #101 from bluss/num-features
Make rustc-serialize, bignum, rational, complex into opt-out features
2015-06-02 16:54:05 -07: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
Alex Crichton aeebff3578 Bump to 0.1.25 2015-05-26 07:35:37 -07:00
Alex Crichton ff6f8d9d29 Merge pull request #98 from clatour/rustup
Update num-macros to rust nightly
2015-05-26 07:36:04 -07:00
Alex Crichton 0a7847cd65 Merge pull request #99 from b52/issue-93-float-min-positive
Provide generic around f32/f64::MIN_POSITIVE
2015-05-26 07:23:41 -07:00
Alex Crichton 3f69d7632f Merge pull request #100 from b52/issue-92-reexport-cast
Re-export `cast` for ergonomic reasons
2015-05-26 07:23:13 -07:00
Alex Crichton 82645a31df Don't print to stdout on `cargo bench` 2015-05-26 07:21:12 -07:00
Oliver Mader 785e07d83c Re-export `cast` for ergonomic reasons 2015-05-26 15:03:34 +02:00
Oliver Mader 6c9f457712 Provide generic around f32/f64::MIN_POSITIVE 2015-05-26 14:56:43 +02:00
Chandler Latour 9399e4ff88 Change Annotatable to &Annotatable for nightly
See: rust-lang/rust#25683
2015-05-24 13:10:49 -06:00
Alex Crichton a6a399d52e Enable testing on stable Rust 2015-05-19 09:22:06 -07:00
Alex Crichton edcb6295ff Bump to 0.1.24 2015-05-18 09:21:01 -07:00
Alex Crichton dab8c6de71 Merge pull request #96 from renato-zannon/rustup
Update num-macros to rust master
2015-05-18 08:58:12 -07:00
Alex Crichton 0ab1010b10 Merge pull request #95 from runarberg/master
Added the power method for rational numbers
2015-05-18 08:42:22 -07:00
Renato Zannon e8450fd47a Update num-macros to rust master 2015-05-18 06:48:58 -03:00
runarberg 505eb86c18 Added the power method for rational numbers 2015-05-17 18:22:32 +00:00
Alex Crichton 44679902bd Update num-macros to Rust master 2015-05-14 10:19:47 -07:00
Alex Crichton b75dbbdfcb Rename num_macros to num-macros 2015-05-01 18:00:02 -07:00
Alex Crichton dc0a0452c6 Merge branch 'master' of https://github.com/erickt/num
Conflicts:
	Cargo.toml
2015-05-01 17:59:53 -07:00