summaryrefslogtreecommitdiffstats
path: root/src/test/ui/numbers-arithmetic/div-mod.rs
blob: acb92a7df73baccc0b9f3531b496afd9d0e9e2ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// run-pass




pub fn main() {
    let x: isize = 15;
    let y: isize = 5;
    assert_eq!(x / 5, 3);
    assert_eq!(x / 4, 3);
    assert_eq!(x / 3, 5);
    assert_eq!(x / y, 3);
    assert_eq!(15 / y, 3);
    assert_eq!(x % 5, 0);
    assert_eq!(x % 4, 3);
    assert_eq!(x % 3, 0);
    assert_eq!(x % y, 0);
    assert_eq!(15 % y, 0);
}