Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Inconsistent end_of_day result #4989
When either a
jruby-18.104.22.168 behaves as expected:
MRI 2.5.0 behaves as expected:
While I don't know the significance of this specific number, after briefly diving in more, it appears that Rational values somewhere north of
referenced this issue
Jan 18, 2018
Ok, this is unlikely to be trivial, and it's not going to get fixed for 22.214.171.124.
The general problem is lack of good support for Rational time components. In this case the very small Rational usec is getting rounded up to 1s, which pushes the date overnight. I have not dug into the code, but I'm almost certain we're turning the Rational into a 64-bit floating point value, so the resolution at which this happens would be along that boundary.
The reason this won't be in 126.96.36.199 is because there's a lot of work involved in keeping usec (or really nsec) as a Rational if it came in as a Rational. On this timeframe, that's too big a risk.
I suspect the eventual fix for this will be to turn the rational into a BigDecimal and store that internally, so we still have proper numeric operations but do not have to preserve all the Ruby semantics and overhead that go with a Rational object.