• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
UBports Robot Logo UBports Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Calculator: 49,8-2,1=

Scheduled Pinned Locked Moved App Development
7 Posts 5 Posters 1.2k Views 3 Watching
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 Offline
      htc_tattoo
      last edited by 28 Oct 2018, 21:29

      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 Offline
        guru
        last edited by 28 Oct 2018, 23:22

        Same error with OTA3.

        1 Reply Last reply Reply Quote 0
        • D Offline
          dobey
          last edited by 29 Oct 2018, 01:26

          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 29 Oct 2018, 05:41 Reply Quote 0
          • G Offline
            guru @dobey
            last edited by 29 Oct 2018, 05:41

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

            1 Reply Last reply Reply Quote 0
            • D Offline
              dtarrant
              last edited by 2 Nov 2018, 10:07

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

              1 Reply Last reply Reply Quote 1
              • F Offline
                flohack
                last edited by flohack 11 Mar 2018, 21:36 3 Nov 2018, 21:36

                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 Offline
                  htc_tattoo
                  last edited by 4 Nov 2018, 08:10

                  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
                  5 out of 7
                  • First post
                    5/7
                    Last post