Uploaded image for project: 'Core ReactOS'
  1. Core ReactOS
  2. CORE-14871

ReactOS Calculator has less precision than his MS Windows counterpart

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • None
    • Applications
    • 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

        1. calc-mpfr.7z
          231 kB
          Carlo Bramix
        2. image-2024-11-10-18-13-42-888.png
          12 kB
          KRosUser
        3. image-2024-11-10-18-14-14-199.png
          23 kB
          KRosUser
        4. image-2024-11-10-18-50-00-100.png
          75 kB
          Carlo Bramix
        5. image-2024-11-10-18-51-25-144.png
          78 kB
          Carlo Bramix
        6. image-2024-11-15-00-37-34-026.png
          78 kB
          Carlo Bramix
        7. image-2024-11-15-00-38-52-449.png
          76 kB
          Carlo Bramix
        8. image-2024-11-15-00-42-19-673.png
          77 kB
          Carlo Bramix
        9. image-2024-11-15-00-42-32-132.png
          77 kB
          Carlo Bramix
        10. image-2024-11-15-00-47-49-941.png
          77 kB
          Carlo Bramix
        11. mpfr.png
          383 kB
          MrBanana19K
        12. reactos-calc.exe-vs-window2k-calc.exe.png
          334 kB
          MrBanana19K
        13. ReactOS Calc with GMP-MPFR support.png
          13 kB
          Carlo Bramix
        14. ReactOS-screen0.webm
          406 kB
          KRosUser

        Issue Links

          Activity

            People

              Carlo Bramix Carlo Bramix
              MrBanana19K MrBanana19K
              Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated: