about summary refs log tree commit diff
path: root/src/libcore/float.rs
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2012-06-07 18:27:10 -0700
committerPatrick Walton <pcwalton@mimiga.net>2012-06-07 18:27:10 -0700
commite158ce8a9d49767cddf58c3e656d382e16aa232e (patch)
treed3b227cf16dc13235c2793dbec74de0a99314d66 /src/libcore/float.rs
parentd8b113f209006e595e13c1baa1557c1fbedad46d (diff)
downloadrust-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.rs1
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;  }