]> git.lizzy.rs Git - rust.git/blob - tests/ui/numbers-arithmetic/div-mod.rs
Rollup merge of #106644 - alexcrichton:update-wasi-toolchain, r=cuviper
[rust.git] / tests / ui / numbers-arithmetic / div-mod.rs
1 // run-pass
2
3
4
5
6 pub fn main() {
7     let x: isize = 15;
8     let y: isize = 5;
9     assert_eq!(x / 5, 3);
10     assert_eq!(x / 4, 3);
11     assert_eq!(x / 3, 5);
12     assert_eq!(x / y, 3);
13     assert_eq!(15 / y, 3);
14     assert_eq!(x % 5, 0);
15     assert_eq!(x % 4, 3);
16     assert_eq!(x % 3, 0);
17     assert_eq!(x % y, 0);
18     assert_eq!(15 % y, 0);
19 }