unexpected float to integer conversion