Floating point numbers can't store all numbers exactly and operations on them can have rounding errors. When you cast the float to int it just cut off the decimal part. When you think you have 90 you probably have a number that is slightly less than 90 so when the decimal part is thrown away you get 89. If you actually want to round the number you could use std::round. You could also use std::setprecision to change how many decimal digits to show.
Think about it, how would you go about storing anything that doesn't have a denominator representable as a power of 2? You'll always be left with an infinite decimal representation, which must be truncated due to finite storage space, for numbers that do not fulfill x*(1/2^n).