You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the math helpers for LocalTime (e.g. addHours) convert all of the values into milliseconds, then apply the change consistently in milliseconds. This means that addHours(1000) will probably overflow and produce an incorrect result.
Why do you want to add 1000 hours to a time-of-day? I have no idea, but there's no reason we should give back the wrong answer. We should switch to our int division function that returns both quotient and remainder, so that we can apply all of the full hours first, followed by the minute remainders, etc.
The text was updated successfully, but these errors were encountered:
Currently, the math helpers for
LocalTime
(e.g.addHours
) convert all of the values into milliseconds, then apply the change consistently in milliseconds. This means thataddHours(1000)
will probably overflow and produce an incorrect result.Why do you want to add 1000 hours to a time-of-day? I have no idea, but there's no reason we should give back the wrong answer. We should switch to our int division function that returns both quotient and remainder, so that we can apply all of the full hours first, followed by the minute remainders, etc.
The text was updated successfully, but these errors were encountered: