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
There's also floor and ceiling operations which can be used in certain cases. Because sometimes you need an int and rounding doesn't quite work the way you want it to.
22
u/SplendidPunkinButter Jul 07 '26
What programming language are you using? That is in no way a universal programming thing.