2 ms·
At least in Java and other languages, when casting as int truncates, and doesn't round the number, so: ((int) (0.9999999)) == 0 But then there's Math.floor and
by GVRV 15y ago
At least in Java and other languages, when casting as int truncates, and doesn't round the number, so: ((int) (0.9999999)) == 0
But then there's Math.floor and Math.ceil for what you're describing which can be used as well.