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

    convert negative numbers to positive, and back again.

    Scheduled Pinned Locked Moved
    Help and Support
    2
    2
    108
    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.
    • D
      Deeeds
      last edited by

      I have two input values that I'm never sure if they're going to be negative or positive.

      However I need to perform an operation on them (constantly) to impact a third value. This operation needs them to be both positive.

      How do I convert the two incoming numbers to positive, operate on them, and then restore them to negative, and use them again as they were, regardless of whether or not they come into me as positive or negative?

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

        @Deeeds to convert to a positive you could multiply the number by itself and then square root it, or for slightly better performance, multiply by -1 if its less than 0 and use a set input field. You should be able to still use the original value after.

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