diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-12-05 19:22:48 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-12-05 19:23:13 -0800 |
| commit | 4ab1c8805aee4b6a4254fd90695371a06cbcd301 (patch) | |
| tree | dab4555175a51694f1e5fa31d986e3a851b089a1 /src/libcore/float.rs | |
| parent | e23ea24aed95885c8bc59de49c616f60fa5053d1 (diff) | |
| download | rust-4ab1c8805aee4b6a4254fd90695371a06cbcd301.tar.gz rust-4ab1c8805aee4b6a4254fd90695371a06cbcd301.zip | |
Convert Num to explicit self
Diffstat (limited to 'src/libcore/float.rs')
| -rw-r--r-- | src/libcore/float.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/libcore/float.rs b/src/libcore/float.rs index d95b7a276b2..2a86d7ae04f 100644 --- a/src/libcore/float.rs +++ b/src/libcore/float.rs @@ -425,22 +425,22 @@ impl float : Ord { impl float: num::Num { #[inline(always)] - pub pure fn add(other: &float) -> float { return self + *other; } + pub pure fn add(&self, other: &float) -> float { return *self + *other; } #[inline(always)] - pub pure fn sub(other: &float) -> float { return self - *other; } + pub pure fn sub(&self, other: &float) -> float { return *self - *other; } #[inline(always)] - pub pure fn mul(other: &float) -> float { return self * *other; } + pub pure fn mul(&self, other: &float) -> float { return *self * *other; } #[inline(always)] - pub pure fn div(other: &float) -> float { return self / *other; } + pub pure fn div(&self, other: &float) -> float { return *self / *other; } #[inline(always)] - pure fn modulo(other: &float) -> float { return self % *other; } + pure fn modulo(&self, other: &float) -> float { return *self % *other; } #[inline(always)] - pure fn neg() -> float { return -self; } + pure fn neg(&self) -> float { return -*self; } #[inline(always)] - pure fn to_int() -> int { return self as int; } + pure fn to_int(&self) -> int { return *self as int; } #[inline(always)] - static pure fn from_int(n: int) -> float { return n as float; } + static pure fn from_int(&self, n: int) -> float { return n as float; } } #[test] |
