Remove some unnecessary floating-point calculations