Replace some floating point math with integer math.
Replace some floating point math with integer math.