Fix slope inconsistency for 64bit

- Fixed: Slope logic would change between 32bit and 64bit due to float
math.