2018-08-30 12:18:55 +00:00
|
|
|
// run-pass
|
2018-08-31 13:02:01 +00:00
|
|
|
#![allow(unused_comparisons)]
|
2015-03-22 20:13:15 +00:00
|
|
|
|
2011-06-15 18:19:50 +00:00
|
|
|
// Unsigned integer operations
|
2013-02-02 03:43:17 +00:00
|
|
|
pub fn main() {
|
2013-03-29 01:39:09 +00:00
|
|
|
assert!((0u8 < 255u8));
|
|
|
|
assert!((0u8 <= 255u8));
|
|
|
|
assert!((255u8 > 0u8));
|
|
|
|
assert!((255u8 >= 0u8));
|
2013-05-19 02:02:45 +00:00
|
|
|
assert_eq!(250u8 / 10u8, 25u8);
|
|
|
|
assert_eq!(255u8 % 10u8, 5u8);
|
2013-03-29 01:39:09 +00:00
|
|
|
assert!((0u16 < 60000u16));
|
|
|
|
assert!((0u16 <= 60000u16));
|
|
|
|
assert!((60000u16 > 0u16));
|
|
|
|
assert!((60000u16 >= 0u16));
|
2013-05-19 02:02:45 +00:00
|
|
|
assert_eq!(60000u16 / 10u16, 6000u16);
|
|
|
|
assert_eq!(60005u16 % 10u16, 5u16);
|
2013-03-29 01:39:09 +00:00
|
|
|
assert!((0u32 < 4000000000u32));
|
|
|
|
assert!((0u32 <= 4000000000u32));
|
|
|
|
assert!((4000000000u32 > 0u32));
|
|
|
|
assert!((4000000000u32 >= 0u32));
|
2013-05-19 02:02:45 +00:00
|
|
|
assert_eq!(4000000000u32 / 10u32, 400000000u32);
|
|
|
|
assert_eq!(4000000005u32 % 10u32, 5u32);
|
2011-06-15 18:19:50 +00:00
|
|
|
// 64-bit numbers have some flakiness yet. Not tested
|
2011-02-13 05:49:04 +00:00
|
|
|
|
2011-08-19 22:16:48 +00:00
|
|
|
}
|