Integers

202307061605
Status: #idea
Tags: Rust

Integers

let decimal: i32 = 1_000_000; // Equal to 1,000,000
let hex = 0xff;
let oct = 0o77;
let bin = 0b1111_0000;
Warning

Rust does not include integer overflow checks when compiling with the --release flag.
If over flow occurs, it performs two's complement wrapping[1]


References

  1. Data Types
  2. https://rust-book.cs.brown.edu/ch03-02-data-types.html#integer-types

  1. https://rust-book.cs.brown.edu/ch03-02-data-types.html#integer-overflow ↩︎