Details
-
Improvement
-
Resolution: Unresolved
-
Major
-
None
-
None
Description
Hello, this is my very first bug report!
I've noticed that in the calculator of MS Windows decimal numbers are shown with more digits than ReactOS Calculator.
In the photo you can see the result of the operation 9÷7 is shown with with 31 digits in the MS Windows Calculator meanwhile in ReactOS calculator they is shown with only 13 digits.
I've not completely read yet the source codes of the calculator but, as far as I read, the main problem is the calculator performs operations and store resultes in a 64bit double. I did some tests with GCC and I've found out that neither a 128bit long double is sufficient to be able to shown 31 decimals digits without any precision lost but an arbitrary precision arithmetic library, like libmpfr is needed (I will attach also a screenshoot of this).
I think that if ReactOS aims to be a clone of Microsoft Windows 2003 then even the calculator should replicate the same behavior.
I’d like to try convert the calculator’s internal functions to use libmpfr but I do not know if it’s 0k add external dependencies to the project.
EDIT: I am an idiot . calculator already supports arbitrary precision arithmetic with libmpfr, it's only needed add libmpfr and check if works properly. pardon
P.S.: Of course numbers with larger integer part have less decimal digits but the precision on the Windows calculator still greater
Attachments
Issue Links
- blocks
-
CORE-19306 calc: Refactor and improve
- Untriaged
- relates to
-
CORE-12766 Calc crashes on pow operations
- Resolved