We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
As I understood it, casting a double into an int just cuts off the decimal part.
So, the universal solution would be to just add 0.5 to a number and then cast it to int.
Day 2: Operators
You are viewing a single comment's thread. Return to all comments →
As I understood it, casting a double into an int just cuts off the decimal part. So, the universal solution would be to just add 0.5 to a number and then cast it to int.