Nov-20-2018, 07:15 PM
Hi all,
I'm trying to write a calculator to help me with some research that I am doing. I only need the following basic math functions (multiply, divide, add, subtract, square root) but I need exact precision. Also, I am only looking for precise integers, any results with a decimal value are discarded. I have tried utilizing the decimal library but I am running into errors with it, it seems that unless I know the exact level of decimal precision required for each calculation the decimal functions have a tendency to return inaccurate numbers.
Is there a better way to do this? Speed of processing is not so much a factor as accuracy is.
I'm trying to write a calculator to help me with some research that I am doing. I only need the following basic math functions (multiply, divide, add, subtract, square root) but I need exact precision. Also, I am only looking for precise integers, any results with a decimal value are discarded. I have tried utilizing the decimal library but I am running into errors with it, it seems that unless I know the exact level of decimal precision required for each calculation the decimal functions have a tendency to return inaccurate numbers.
Is there a better way to do this? Speed of processing is not so much a factor as accuracy is.