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/float.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/libcore/float.rs') 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; } -- cgit 1.4.1-3-g733a5