We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 253ff59 commit f9c97fbCopy full SHA for f9c97fb
[refs]
@@ -1,5 +1,5 @@
1
---
2
-refs/heads/master: 389125aeb83eb1571ff1ec4e5e140b1ac2109341
+refs/heads/master: 73280b0472afdcf4df7eb1a80a7ac0b74a791ca9
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
refs/heads/snap-stage3: a6d9689399d091c3265f00434a69c551a61c28dc
5
refs/heads/try: ef355f6332f83371e4acf04fc4eb940ab41d78d3
trunk/src/libcore/num/num.rs
@@ -39,6 +39,10 @@ pub trait One {
39
static pure fn one() -> Self;
40
}
41
42
+pub pure fn abs<T: cmp::Ord Num Zero>(v: T) -> T {
43
+ if v < Zero::zero() { v.neg() } else { v }
44
+}
45
+
46
pub trait Round {
47
pure fn round(&self, mode: RoundMode) -> Self;
48
0 commit comments