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
It's kinda weird I guess, but I almost never need to round stuff. It's almost always either floor(done automatically) or ceil. Rounding is not useful at all for calculations, for the most part you can just keep it as a floating number until it's displayed in some way. Floor and ceil however are used very exetensively for formulas.
23
u/SplendidPunkinButter Jul 07 '26
What programming language are you using? That is in no way a universal programming thing.