Comments (4)
I don't have a fix for this, but I can confirm this does happen to me as well. We are trying to update from Ruby 2.7 to 3.1 and we had tests fail due to an unexpected increase in precision that was previously not there. Dropping to 3.0.2 gets the results back to what we expect.
from bigdecimal.
@thorstenspringhart BigDecimal does not preserve the result precision of BigDecimal#/
among the different versions. In recent change, we increased the result precision of BigDecimal#/
for the case of infinite decimals. If you need to control the precision of division, you must use BigDecimal#div
instead of BigDecimal#/
.
from bigdecimal.
Could you please describe more detailed information? I cannot investigate the issue you encountered because I don't know what are other_budget
, amounts_lines
, and ratio_base
.
from bigdecimal.
We have the same issue with a simple unit conversion:
Before the upgrade we had the following result:
0> value = BigDecimal('64')
=> 0.64e2
0> result = (value -32)* 5 /9 +273.15
=> 0.290927777777777777778e3
0> result.to_s
=> "290.927777777777777778"
After the upgrade
0> value = BigDecimal('64')
=> 0.64e2
0> result = (value -32)* 5 /9 +273.15
=> 0.290927777777777777777777777777777777778e3
0> result.to_s
=> "290.927777777777777777777777777777777778"
from bigdecimal.
Related Issues (20)
- Add the new property to obtain the number of digits after the decimal point
- bignum too big to convert into `long' (RangeError) HOT 4
- Bugs when DECDIG == uint16_t
- BUG: BigDecimal#precision returns a wrong result when the number consists of single DECDIG
- Method BigDecimal: precision too large. (ArgumentError) HOT 2
- Method BigDecimal: 0 digits algorithm HOT 2
- Accept a Float value in BigDecimal#div when a precision is given HOT 2
- BigDecimal should accept a Float value without a precision
- BigDecimal#quo should accept a precision argument
- "ERROR(VpDivd): space for remainder too small" for certain division HOT 3
- Exponential growth in precision causing memory usage to spike as of 3.1.2 HOT 5
- ERROR(VpDivd): space for remainder too small
- BigDecimal#round raises FloatDomainError regardless of exception mode HOT 2
- Comparison failure: 9.8.abs <= BigDecimal('9.8') => false HOT 4
- Inconsistent max precision affecting dump&load result HOT 4
- BigDecimal#n_significant_digits and #precision do not return the correct value HOT 1
- I would expect BigDecimal#divmod to return type [Int, BigDecimal] (like Integer#divmod, Float#divmod)
- mode(BigDecimal::EXCEPTION_ALL,true) did not throw an exception when bigdecimal#exponent overflowed HOT 1
- Integrate JRuby implementation into the gem
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bigdecimal.