Skip to content

Commit a682d6c

Browse files
committed
---
yaml --- r: 101368 b: refs/heads/master c: 1388c05 h: refs/heads/master v: v3
1 parent 0843e89 commit a682d6c

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
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 4109caffc320018d93e9ae7f739d6f25dfe003f1
2+
refs/heads/master: 1388c053a8b59347b607674fb5b83910d309aa9b
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6e7f170fedd3c526a643c0b2d13863acd982be02
55
refs/heads/try: a97642026c18a624ff6ea01075dd9550f8ed07ff

trunk/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)