Giter VIP home page Giter VIP logo

Comments (4)

wheresrobert avatar wheresrobert commented on June 16, 2024 1

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.

mrkn avatar mrkn commented on June 16, 2024 1

@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.

mrkn avatar mrkn commented on June 16, 2024

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.

thorstenspringhart avatar thorstenspringhart commented on June 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.