aboutsummaryrefslogtreecommitdiff
path: root/src/test/run-pass/div-mod.rs
blob: 00835d41c721073c043cceb8ac30ef1ceed8c460 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// -*- rust -*-

fn main() {
  let int x = 15;
  let int y = 5;
  assert (x / 5 == 3);
  assert (x / 4 == 3);
  assert (x / 3 == 5);
  assert (x / y == 3);
  assert (15 / y == 3);

  assert (x % 5 == 0);
  assert (x % 4 == 3);
  assert (x % 3 == 0);
  assert (x % y == 0);
  assert (15 % y == 0);
}