PageRenderTime 8ms CodeModel.GetById 1ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/src/test/run-pass/div-mod.rs

http://github.com/jruderman/rust
Rust | 18 lines | 14 code | 3 blank | 1 comment | 10 complexity | 666d5a4dfdb5a8422ade46bda17be5f6 MD5 | raw file
 1
 2
 3
 4// -*- rust -*-
 5fn main() {
 6    let x: int = 15;
 7    let y: int = 5;
 8    assert (x / 5 == 3);
 9    assert (x / 4 == 3);
10    assert (x / 3 == 5);
11    assert (x / y == 3);
12    assert (15 / y == 3);
13    assert (x % 5 == 0);
14    assert (x % 4 == 3);
15    assert (x % 3 == 0);
16    assert (x % y == 0);
17    assert (15 % y == 0);
18}