fork download
  1.  
  2. use std::i32;
  3.  
  4. fn foo(mut x:i32) {
  5. if (x < 0) {
  6. x = -x;
  7. }
  8.  
  9. if (x >= 0) {
  10. println!("{} is >= 0\n", x);
  11. } else {
  12. println!("{} is < 0\n", x);
  13. }
  14. }
  15.  
  16. fn main() {
  17.  
  18. foo(-1);
  19. foo(std::i32::MIN);
  20. }
  21.  
Success #stdin #stdout 0s 5572KB
stdin
Standard input is empty
stdout
1 is >= 0

-2147483648 is < 0