2018-08-30 14:18:55 +02:00
|
|
|
// run-pass
|
2010-06-23 21:03:09 -07:00
|
|
|
|
|
|
|
|
2011-06-15 11:19:50 -07:00
|
|
|
|
2015-03-22 13:13:15 -07:00
|
|
|
|
2013-02-01 19:43:17 -08:00
|
|
|
pub fn main() {
|
2015-03-25 17:06:52 -07:00
|
|
|
let x: isize = 15;
|
|
|
|
let y: isize = 5;
|
2013-05-18 22:02:45 -04:00
|
|
|
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);
|
2011-08-19 15:16:48 -07:00
|
|
|
}
|