Skip to content

Commit 2ffd888

Browse files
committed
---
yaml --- r: 102508 b: refs/heads/auto c: 1388c05 h: refs/heads/master v: v3
1 parent ad54cb2 commit 2ffd888

File tree

2 files changed

+1
-61
lines changed

2 files changed

+1
-61
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 4109caffc320018d93e9ae7f739d6f25dfe003f1
16+
refs/heads/auto: 1388c053a8b59347b607674fb5b83910d309aa9b
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/libstd/num/uint.rs

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -25,59 +25,6 @@ use unstable::intrinsics;
2525

2626
uint_module!(uint, int, ::int::BITS)
2727

28-
///
29-
/// Divide two numbers, return the result, rounded up.
30-
///
31-
/// # Arguments
32-
///
33-
/// * x - an integer
34-
/// * y - an integer distinct from 0u
35-
///
36-
/// # Return value
37-
///
38-
/// The smallest integer `q` such that `x/y <= q`.
39-
///
40-
pub fn div_ceil(x: uint, y: uint) -> uint {
41-
let div = x / y;
42-
if x % y == 0u { div }
43-
else { div + 1u }
44-
}
45-
46-
///
47-
/// Divide two numbers, return the result, rounded to the closest integer.
48-
///
49-
/// # Arguments
50-
///
51-
/// * x - an integer
52-
/// * y - an integer distinct from 0u
53-
///
54-
/// # Return value
55-
///
56-
/// The integer `q` closest to `x/y`.
57-
///
58-
pub fn div_round(x: uint, y: uint) -> uint {
59-
let div = x / y;
60-
if x % y * 2u < y { div }
61-
else { div + 1u }
62-
}
63-
64-
///
65-
/// Divide two numbers, return the result, rounded down.
66-
///
67-
/// Note: This is the same function as `div`.
68-
///
69-
/// # Arguments
70-
///
71-
/// * x - an integer
72-
/// * y - an integer distinct from 0u
73-
///
74-
/// # Return value
75-
///
76-
/// The smallest integer `q` such that `x/y <= q`. This
77-
/// is either `x/y` or `x/y + 1`.
78-
///
79-
pub fn div_floor(x: uint, y: uint) -> uint { return x / y; }
80-
8128
#[cfg(target_word_size = "32")]
8229
impl CheckedAdd for uint {
8330
#[inline]
@@ -151,10 +98,3 @@ fn test_overflows() {
15198
assert!((uint::MIN <= 0u));
15299
assert!((uint::MIN + uint::MAX + 1u == 0u));
153100
}
154-
155-
#[test]
156-
fn test_div() {
157-
assert!((div_floor(3u, 4u) == 0u));
158-
assert!((div_ceil(3u, 4u) == 1u));
159-
assert!((div_round(3u, 4u) == 1u));
160-
}

0 commit comments

Comments
 (0)