Skip to content

Fix #7104#7111

Merged
enebo merged 1 commit intojruby:jruby-9.3from
k77ch7:ruby-3.1-fix-gh7104
Feb 23, 2022
Merged

Fix #7104#7111
enebo merged 1 commit intojruby:jruby-9.3from
k77ch7:ruby-3.1-fix-gh7104

Conversation

@k77ch7
Copy link
Contributor

@k77ch7 k77ch7 commented Feb 20, 2022

This commit changes the way to get the digits of an integer.

In Java, the Math.log10 function treats a long as double type.
When an integer is large, a rounding error occurs and sizeWithDecimalString function gets the wrong digits.

@k77ch7
Copy link
Contributor Author

k77ch7 commented Feb 20, 2022

I think this PR be able to backport to 9.3.x

@enebo enebo changed the base branch from master to jruby-9.3 February 22, 2022 18:40
@enebo enebo changed the base branch from jruby-9.3 to master February 22, 2022 18:41
@enebo
Copy link
Member

enebo commented Feb 22, 2022

@k77ch7 Can you rebase this against jruby-9.3? I think it should go back to 9.3 as well. If I change base to jruby-9.3 using PR it ends up being the worlds largest merge :)

@enebo enebo added this to the JRuby 9.3.4.0 milestone Feb 22, 2022
This commit changes the way to get the digits of an integer.

In Java, the Math.log10 function treats a long as double type.
When an integer is large, a rounding error occurs and sizeWithDecimalString function gets the wrong digits.
@k77ch7 k77ch7 force-pushed the ruby-3.1-fix-gh7104 branch from 750a078 to 34df0af Compare February 23, 2022 06:40
@k77ch7 k77ch7 changed the base branch from master to jruby-9.3 February 23, 2022 06:42
@k77ch7
Copy link
Contributor Author

k77ch7 commented Feb 23, 2022

@enebo I finish rebasing this against jruby-9.3.

@enebo enebo merged commit 381e5ac into jruby:jruby-9.3 Feb 23, 2022
@enebo
Copy link
Member

enebo commented Feb 23, 2022

Thanks @k77ch7 ... In what is becoming a pattern ... I wonder if we have this rounding problem elsewhere? :)

@k77ch7
Copy link
Contributor Author

k77ch7 commented Feb 24, 2022

@enebo I'm not sure about that...
BTW the current master still has same problem. Should I make same PR against the master?

@enebo
Copy link
Member

enebo commented Feb 24, 2022

@k77ch7 All fixes on jruby-9.3 will merge to master periodically. So we will get this fix there pretty soon.

@k77ch7
Copy link
Contributor Author

k77ch7 commented Feb 24, 2022

@enebo Thanks. I understand.

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.

2 participants