Skip to content

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

Merged
headius merged 3 commits intojruby:masterfrom
tychobrailleur:time_precision
May 21, 2013
Merged

Fix precision issues in Time by avoiding conversions to nanoseconds. #745
headius merged 3 commits intojruby:masterfrom
tychobrailleur:time_precision

Conversation

@tychobrailleur
Copy link
Contributor

Fixes #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.

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.
headius added a commit that referenced this pull request May 21, 2013
Fix precision issues in Time by avoiding conversions to nanoseconds.
@headius headius merged commit 7f4335c into jruby:master May 21, 2013
@headius
Copy link
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BC Date (with ActiveSupport) regression

2 participants