Move common floor() code into floorImpl()