summaryrefslogtreecommitdiff
path: root/meap/meap-code/ch2/ch2-non-base2.rs
blob: 232c3688ce1fecf6b89e75a4184c9c5aad8bba56 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
fn main() {
  let three = 0b11; // <1>
  let thirty = 0o36; // <2>
  let three_hundred = 0x12C; // <3>

  println!("{} {} {}", three, thirty, three_hundred);
  println!("{:b} {:b} {:b}", three, thirty, three_hundred);
  println!("{:o} {:o} {:o}", three, thirty, three_hundred);
  println!("{:x} {:x} {:x}", three, thirty, three_hundred);
}