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
Time.at loses precision when using BigDecimal as argument #3616
I was debugging why logstash was losing precision with a gelf input, it ended up to be a jRuby bug (maybe).
These are the steps to reproduce the issue:
referenced this issue
Jan 26, 2016
This is a known issue...as in I've known about it. MRI represents their Time object internally with much more type flexibility...Bignums, Bigdecimals, Rationals. We do not have this flexibility wired into our various Time constructors and methods.
In this case, I'd guess we're simply truncating to Fixnum any input to Time.at.
@alex88 I wonder if you'd like to expand the test cases for Time.at (and friends) in https://github.com/ruby/spec? It appears we're failing two cases related to
For example the time specs: