if do_calc does floating-point math, there’s a chance that you have floating-point errors. its neither your code nor ruby, but a problem with floating points and binary representation in general, since there are some numbers that cant be presented in binary, they are just rounded to be approx. the right value. for more info on that, google is your friend, since i dont really know how to explain that in english