Skip to content

Commit 05c2b1a

Browse files
committed
---
yaml --- r: 14254 b: refs/heads/try c: ad2f566 h: refs/heads/master v: v3
1 parent 973d5c2 commit 05c2b1a

File tree

6 files changed

+26
-1
lines changed

6 files changed

+26
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: acc57a44fde9e60163f3d4700bdca453f8a23a11
5+
refs/heads/try: ad2f566ff244f442be5c4b304729a534d8a8185c
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/libcore/i16.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,8 @@ fn range(lo: i16, hi: i16, it: fn(i16)) {
3434
fn compl(i: i16) -> i16 {
3535
u16::compl(i as u16) as i16
3636
}
37+
38+
#[doc = "Computes the absolute value"]
39+
fn abs(i: i16) -> i16 {
40+
if negative(i) { -i } else { i }
41+
}

branches/try/src/libcore/i32.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,8 @@ fn range(lo: i32, hi: i32, it: fn(i32)) {
3434
fn compl(i: i32) -> i32 {
3535
u32::compl(i as u32) as i32
3636
}
37+
38+
#[doc = "Computes the absolute value"]
39+
fn abs(i: i32) -> i32 {
40+
if negative(i) { -i } else { i }
41+
}

branches/try/src/libcore/i64.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,8 @@ fn range(lo: i64, hi: i64, it: fn(i64)) {
3434
fn compl(i: i64) -> i64 {
3535
u64::compl(i as u64) as i64
3636
}
37+
38+
#[doc = "Computes the absolute value"]
39+
fn abs(i: i64) -> i64 {
40+
if negative(i) { -i } else { i }
41+
}

branches/try/src/libcore/i8.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,8 @@ fn range(lo: i8, hi: i8, it: fn(i8)) {
3434
fn compl(i: i8) -> i8 {
3535
u8::compl(i as u8) as i8
3636
}
37+
38+
#[doc = "Computes the absolute value"]
39+
fn abs(i: i8) -> i8 {
40+
if negative(i) { -i } else { i }
41+
}

branches/try/src/libcore/int.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,11 @@ fn compl(i: int) -> int {
191191
uint::compl(i as uint) as int
192192
}
193193

194+
#[doc = "Computes the absolute value"]
195+
fn abs(i: int) -> int {
196+
if negative(i) { -i } else { i }
197+
}
198+
194199
#[test]
195200
fn test_from_str() {
196201
assert(from_str("0") == 0);

0 commit comments

Comments
 (0)