Changed int parameters to float

For wrapAngle and limit angle. Also removed local result variable.