diff options
| author | bors <bors@rust-lang.org> | 2013-05-01 01:51:35 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-05-01 01:51:35 -0700 |
| commit | f67239fac3cc521fedaf14faf5357beab78caea8 (patch) | |
| tree | 6d6d050de821c8dbfd16ea84500f9616298b3cb0 /src/libstd/num/complex.rs | |
| parent | bfccfdc78065752079a3863db19ca7148ade3e6f (diff) | |
| parent | ee26c7c433dbb8d41a2b65dbc89eb84acfc2d311 (diff) | |
| download | rust-f67239fac3cc521fedaf14faf5357beab78caea8.tar.gz rust-f67239fac3cc521fedaf14faf5357beab78caea8.zip | |
auto merge of #6147 : bjz/rust/numeric-traits, r=brson
After much discussion on IRC and #4819, we have decided to revert to the old naming of the `/` operator. This does not change its behavior. In making this change, we also have had to rename some of the methods in the `Integer` trait. Here is a list of the methods that have changed: - `Quot::quot` -> `Div::div` - `Rem::rem` - stays the same - `Integer::quot_rem` -> `Integer::div_rem` - `Integer::div` -> `Integer::div_floor` - `Integer::modulo` -> `Integer::mod_floor` - `Integer::div_mod` -> `Integer::div_mod_floor`
Diffstat (limited to 'src/libstd/num/complex.rs')
| -rw-r--r-- | src/libstd/num/complex.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstd/num/complex.rs b/src/libstd/num/complex.rs index 02393b15cca..41d2b4a101c 100644 --- a/src/libstd/num/complex.rs +++ b/src/libstd/num/complex.rs @@ -102,9 +102,9 @@ impl<T: Copy + Num> Mul<Cmplx<T>, Cmplx<T>> for Cmplx<T> { // (a + i b) / (c + i d) == [(a + i b) * (c - i d)] / (c*c + d*d) // == [(a*c + b*d) / (c*c + d*d)] + i [(b*c - a*d) / (c*c + d*d)] -impl<T: Copy + Num> Quot<Cmplx<T>, Cmplx<T>> for Cmplx<T> { +impl<T: Copy + Num> Div<Cmplx<T>, Cmplx<T>> for Cmplx<T> { #[inline] - fn quot(&self, other: &Cmplx<T>) -> Cmplx<T> { + fn div(&self, other: &Cmplx<T>) -> Cmplx<T> { let norm_sqr = other.norm_sqr(); Cmplx::new((self.re*other.re + self.im*other.im) / norm_sqr, (self.im*other.re - self.re*other.im) / norm_sqr) @@ -275,7 +275,7 @@ mod test { } } #[test] - fn test_quot() { + fn test_div() { assert_eq!(_neg1_1i / _0_1i, _1_1i); for all_consts.each |&c| { if c != Zero::zero() { |
