diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2012-06-07 18:27:10 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2012-06-07 18:27:10 -0700 |
| commit | e158ce8a9d49767cddf58c3e656d382e16aa232e (patch) | |
| tree | d3b227cf16dc13235c2793dbec74de0a99314d66 /src/libcore/float.rs | |
| parent | d8b113f209006e595e13c1baa1557c1fbedad46d (diff) | |
| download | rust-e158ce8a9d49767cddf58c3e656d382e16aa232e.tar.gz rust-e158ce8a9d49767cddf58c3e656d382e16aa232e.zip | |
Add neg() to the num iface
Diffstat (limited to 'src/libcore/float.rs')
| -rw-r--r-- | src/libcore/float.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libcore/float.rs b/src/libcore/float.rs index a2b5197277a..d55c0e0c371 100644 --- a/src/libcore/float.rs +++ b/src/libcore/float.rs @@ -416,6 +416,7 @@ impl num of num for float { fn mul(&&other: float) -> float { ret self * other; } fn div(&&other: float) -> float { ret self / other; } fn modulo(&&other: float) -> float { ret self % other; } + fn neg() -> float { ret -self; } fn to_int() -> int { ret self as int; } fn from_int(n: int) -> float { ret n as float; } |
