int x; x = 5.9; //this would give you a warning like in your example x = int(5.9); //this truncates correctly, and gives no warning