about summary refs log tree commit diff
path: root/src/libcore/uint-template.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/uint-template.rs
parentd8b113f209006e595e13c1baa1557c1fbedad46d (diff)
Add neg() to the num iface
Diffstat (limited to 'src/libcore/uint-template.rs')
-rw-r--r--src/libcore/uint-template.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libcore/uint-template.rs b/src/libcore/uint-template.rs
index 9d658605f5a..d1d238d298c 100644
--- a/src/libcore/uint-template.rs
+++ b/src/libcore/uint-template.rs
@@ -70,6 +70,7 @@ impl num of num for T {
     fn mul(&&other: T)    -> T { ret self * other; }
     fn div(&&other: T)    -> T { ret self / other; }
     fn modulo(&&other: T) -> T { ret self % other; }
+    fn neg()              -> T { ret -self;        }
 
     fn to_int()         -> int { ret self as int; }
     fn from_int(n: int) -> T   { ret n as T;      }