Advertisement
cwchen

[Rust] Overflow demo

Aug 22nd, 2017
773
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 0.10 KB | None | 0 0
  1. use std::i32;
  2.  
  3. fn main() {
  4.     let mut n: i32 = i32::max_value();
  5.  
  6.     // Overflow
  7.     n = n + 1;  
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement