Navigation

    UBports Robot Logo

    UBports Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Calculator: 49,8-2,1=

    App Development
    5
    7
    919
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      htc_tattoo last edited by

      I was astonished when i calculated
      49.8-2.1=47.699999999999996
      I learned different in school. Yes, it's true, i could have calculated in my head. But i was lazy...
      Calculator Version 2.3.4 i used.

      1 Reply Last reply Reply Quote 0
      • G
        guru last edited by

        Same error with OTA3.

        1 Reply Last reply Reply Quote 0
        • dobey
          dobey last edited by

          Please open an issue at https://github.com/ubports/ubuntu-touch/issues about the problem. The forum is not an issue tracker, so reporting problems here is not especially helpful.

          G 1 Reply Last reply Reply Quote 0
          • G
            guru @dobey last edited by

            https://github.com/ubports/ubuntu-touch/issues/940

            1 Reply Last reply Reply Quote 0
            • D
              dtarrant last edited by

              Seems to be fixed now: 49.8-2.1=47.7! πŸ‘

              1 Reply Last reply Reply Quote 1
              • Flohack
                Flohack last edited by Flohack

                When you would read a bit about this problem, it would be more clear to you: In contrast to integer numbers floating point numbers can almost never calculated precisely on any CPU / computer on the market.

                If you are interested please read e.g. https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html - Its a bit inclined but explains a lot.

                Bottom line, what you learned in school is right, and the CPU lied to you. Unfortunately it did not round the number so to hide the lie πŸ˜‰

                We fixed it by updating math.js from a 2015 version to 2018. 3 years pass and the lie seems to be perfect now πŸ˜‰

                BR

                My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

                1 Reply Last reply Reply Quote 3
                • H
                  htc_tattoo last edited by

                  Thanks a lot for fixing this! Although it's just a funny small problem, fixing this tiny bugs also lead to a better system.
                  If i compare UT today with 1 or 2 years ago it improved really a lot! Stability, features and speed!

                  1 Reply Last reply Reply Quote 2
                  • First post
                    Last post