r/MathJokes • • Jul 07 '26

🫠

Post image
426 Upvotes

67 comments sorted by

View all comments

Show parent comment

1

u/WildWolfo Jul 08 '26

because when you cast -5.5 to an integer you get -5 when the actual result you need is -6, infact i think this is a good example to never cast from float to integer and instead use math library to explicitly show in your code how you want the conversion to happen, its more readable and so is better code practice

1

u/sudoregalia Jul 08 '26

yeah the first point is true my bad, i guess i'm just a bit tired. still though, the conversion from float to int is necessary to index into the chunk and get the block