PageRenderTime 13ms CodeModel.GetById 1ms app.highlight 9ms RepoModel.GetById 1ms app.codeStats 0ms

/src/test/run-pass/arith-unsigned.rs

http://github.com/jruderman/rust
Rust | 26 lines | 20 code | 4 blank | 2 comment | 6 complexity | 743107b1bc82f9fd7b6b8c68b69c12cb MD5 | raw file
 1
 2
 3
 4// Unsigned integer operations
 5fn main() {
 6    assert (0u8 < 255u8);
 7    assert (0u8 <= 255u8);
 8    assert (255u8 > 0u8);
 9    assert (255u8 >= 0u8);
10    assert (250u8 / 10u8 == 25u8);
11    assert (255u8 % 10u8 == 5u8);
12    assert (0u16 < 60000u16);
13    assert (0u16 <= 60000u16);
14    assert (60000u16 > 0u16);
15    assert (60000u16 >= 0u16);
16    assert (60000u16 / 10u16 == 6000u16);
17    assert (60005u16 % 10u16 == 5u16);
18    assert (0u32 < 4000000000u32);
19    assert (0u32 <= 4000000000u32);
20    assert (4000000000u32 > 0u32);
21    assert (4000000000u32 >= 0u32);
22    assert (4000000000u32 / 10u32 == 400000000u32);
23    assert (4000000005u32 % 10u32 == 5u32);
24    // 64-bit numbers have some flakiness yet. Not tested
25
26}