diff options
author | Kir Shatrov <shatrov@me.com> | 2017-01-22 10:28:01 -0500 |
---|---|---|
committer | Kir Shatrov <shatrov@me.com> | 2017-01-22 10:28:01 -0500 |
commit | 7ec30400e12d547ab573281c442ccb8a48d80495 (patch) | |
tree | 75d2b39e5a2207070cf3e2f4af472e1c5a72339f /activesupport/CHANGELOG.md | |
parent | 20107ff6c80a7e162adf22176eee811a59498126 (diff) | |
download | rails-7ec30400e12d547ab573281c442ccb8a48d80495.tar.gz rails-7ec30400e12d547ab573281c442ccb8a48d80495.tar.bz2 rails-7ec30400e12d547ab573281c442ccb8a48d80495.zip |
Make BigDecimal casting consistent on different platforms
Right now it behaves differently on JRuby:
```
--- expected
+++ actual
@@ -1 +1 @@
-#<BigDecimal:5f3c866c,'0.333333333333333333',18(20)>
+#<BigDecimal:16e0afab,'0.3333333333333333',16(20)>
```
My initial PR (https://github.com/rails/rails/pull/27324)
offered to let the precision to be decided by the platform and
change the test expection, but other contributors suggested
that we should change the default precision in Rails
to be consistent of all platforms.
The value (18) comes from the max default precision that comes
from casting Rational(1/3) to BigDecimal.
Diffstat (limited to 'activesupport/CHANGELOG.md')
0 files changed, 0 insertions, 0 deletions