From e158ce8a9d49767cddf58c3e656d382e16aa232e Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Thu, 7 Jun 2012 18:27:10 -0700 Subject: Add neg() to the num iface --- src/libcore/uint-template.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/libcore/uint-template.rs') 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; } -- cgit 1.4.1-3-g733a5