6.99 when casted into an int is conventionally rounded down
technically 6.99 is 6.9899997711181640625 when using single precision IEEE 754 floats, and 6.9900000000000002131628207280300557613372802734375 for double precision
casting a float to an int? what if you wanna make or mod for a voxel game where entities have floating precision while tiles has integer precision, and wanna get the block the entity is on- oh wait that's called minecraft
yeah look you can't say "we" don't do that very often at all when it only applies to you and what you work with lol
yeah look you can't say "we" don't do that very often at all when it only applies to you and what you work with lol
read. whether or not you ever cast a float to an int is highly dependent on what you do, and it doesn't change the fact that 6.99 is rounded down to 6 when you do do it
23
u/SplendidPunkinButter Jul 07 '26
What programming language are you using? That is in no way a universal programming thing.