Improved float/double to int/long conversion