Ask HN: How to handle financial calculations precisely?
2 by fedeb95 | 0 comments on Hacker News.
I am talking of a Java world, but this extends to any language I think. Basically the problem is the following: given a set of (positive) floating point numbers, which sum up to x, how do I rescale them in the range [0, 1] so that this new set, when multiplied with x, gives the original set, up to the second decimal place? The max x I expect to encounter is probably in the order of 10000000000, just to be sure. I've run a quick property based test, and the results are precise only if I use BigDecimal with a MathContext with precision of 8, rounding half up. Is there some mathematical proof of how much precision I need for this problem?
Don't forget to subscribe our youtube channel Click here:- http://www.youtube.com/c/techgk Product of the day
Post Top Ad
Responsive Ads Here
Home
Latest technews
New ask Hacker News story: Ask HN: How to handle financial calculations precisely?
New ask Hacker News story: Ask HN: How to handle financial calculations precisely?
Share This
Subscribe to:
Post Comments (Atom)
Post Bottom Ad
Responsive Ads Here
Author Details
Templatesyard is a blogger resources site is a provider of high quality blogger template with premium looking layout and robust design. The main mission of templatesyard is to provide the best quality blogger templates which are professionally designed and perfectlly seo optimized to deliver best result for your blog.
No comments:
Post a Comment