use explicit float casts where appropriate