I'm looking for a package or any other solution that will help me in handling fixed point decimal numbers, their arithmetic and rounding in R. The main purpose is to make monetary calculations without floating point errors and being able to control precision and rounding.
I've done a research for eg. I've read about Brobdingnag, Rmpfr, gmp. Also I've taken a look at some threads that were discussing the topic like for eg. this one and these that were mentioned over there (and many others). It's a pity, but none offers a solution that fullfils my requirements which are as follows. As the found questions are old I allow myself to refresh the issue.
The requirements for a package/solution are:
- It let us get exact decimal representation.
- It supports fixed point arithmetic.
- We are able to control precision and rounding.
- It let print a number to decimal.
I would point Python's Decimal or Java's Big Decimal packages as examples which meet all the criteria and am looking for an equivalent in R.
I hope that some of you may have an idea what can help or how to prepare our own solution. Supposedly this topic can help somebody else, too.
Looking forward for your response and thanks in advance.
Tomasz