[Ruby] Calculation results between decimal points are different, different, and not what you intended.

Details are below.

https://qiita.com/yusabana/items/fd4a0185c1f120403a74

It's a story that you have to set BigDecimal, One thing is that it is not supported even though it is used in the instance declaration source, and probably because if you use BigDecimal, it will have the same number of digits as the instance source. There is a possibility that you have to calculate by specifying the number of digits in the second argument using .add, .sub, .mult, .div.

Moreover, this was latent due to an existing defect. It's not a priority because the changes made this time were unknown before that, For some reason, it seems that accuracy is required in the test, so it will be a flow to have the client decide the response policy by additionally reporting and consulting. (Don't decide on your own)

I wonder if it's okay, I will add that I have confirmed the response policy once and agreed.

As a pitfall for changing differences from existing specifications I learned that it will eventually be overturned where there is no change. .. ..

Yada again. .. ..

Recommended Posts

[Ruby] Calculation results between decimal points are different, different, and not what you intended.
What if the results of sum and inject (: +) are different?
[Ruby] Big Decimal and DECIMAL
[Ruby comprehension check] Can you explain what is happening? && and and