Split float-int conversion algorithm up for clarity