Fix precision issues in Time by avoiding conversions to nanoseconds. #745

Merged
merged 3 commits into from May 21, 2013

Projects

None yet

2 participants

@tychobrailleur
Contributor

Fixes jruby/jruby#652

Calculations using Time are done to the nanosecond. When using dates,
the Unix time converted into nanosecond is too big (in absolute value)
to fit in a long. The idea in this fix is to separate the millisecond
calculation from the nanosecond one to avoid converting these dates
into nanoseconds.

tychobrailleur added some commits May 19, 2013
@tychobrailleur tychobrailleur Fix precision issues in Time by avoiding conversions to nanoseconds.
Calculations using Time are done to the nanosecond.  When using dates,
the Unix time converted into nanosecond is too big (in absolute value)
to fit in a `long`.  The idea in this fix is to separate the millisecond
calculation from the nanosecond one to avoid converting these dates
into nanoseconds.
ffc93bf
@tychobrailleur tychobrailleur Remove useless casts. dc8cc8d
@tychobrailleur tychobrailleur Fix nanosecond precision for minus operation. 15e3ad2
@headius headius merged commit 7f4335c into jruby:master May 21, 2013

1 check was pending

default The Travis CI build is in progress
Details
@headius
Member
headius commented May 21, 2013

CI is in a weird state, but your code looks fine. Merging and will test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment