fix incorrect rounding behavior for negative numbers. thanks @guybrush!