logo hyperPad Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Login

    Random Number Inconsistency With Negative Values And Decimal Values

    Scheduled Pinned Locked Moved
    Bug Reports
    3
    5
    672
    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.
    • Jack8680J
      Jack8680
      last edited by Jack8680

      When a random number is picked between two positive values, both numbers can be selected, but when a negative number is used, the lower bound is one higher. For example, a random number between 1 and 3 can return 1, 2, or 3. But a random number between -1 and 1 will only return 0 or 1. The lower value is not included. I've always worked around this, but it's slightly annoying. Another bug with random numbers is that when a decimal is used, it ceilings the upper bound. For example, a random number between 0.0 and 1.3 can return 1.9.
      EDIT: after further testing, it turns out it doesn't ceiling the upper bound, but adds one. So the previous example could even return 2.2.

      1 Reply Last reply Reply Quote 0
      • HamedH
        Hamed Admin
        last edited by

        For any new random number behaviour, this is fixed.

        1 Reply Last reply Reply Quote 0
        • MurtazaM
          Murtaza Admin
          last edited by

          In the next update (1.17)

          Jack8680J 1 Reply Last reply Reply Quote 0
          • Jack8680J
            Jack8680 @Murtaza
            last edited by

            @Murtaza will there be a new TestFlight beta released soon?

            1 Reply Last reply Reply Quote 0
            • HamedH
              Hamed Admin
              last edited by

              @Jack8680 right now. Go check the testflight app or your emails for the latest build.

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