User Tag List

Results 1 to 4 of 4

Thread: is there a simple equation to turn any number into -1, 1, or 0?

  1. #1
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,274
    Mentioned
    90 Post(s)
    Tagged
    0 Thread(s)

    is there a simple equation to turn any number into -1, 1, or 0?

    Is there a simple equation to turn any number into -1, 1, or 0? Essentially, I just want to be able to deduce whether a number is positive or negative. But without using a condition - instead, using an equation that I can use in an expression.

    I'm sure there must be some simple equation that will take -2, -94, and -2234234.12 and return -1 (or 2, 94, and 22343234.12, and return 1), but I can't think of one because my maths is pretty poor.

  2. #2
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Posts
    1,305
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    n / abs( n )

  3. #3
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,274
    Mentioned
    90 Post(s)
    Tagged
    0 Thread(s)
    of course! thanks

    edit: though I guess if n is 0, that produces a division by 0. How does Fusion handle div by 0? Would it just return 0, or would it likely break something?

  4. #4
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Posts
    1,305
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    It would just return "0".

Similar Threads

  1. What am I missing? From this equation.
    By Jusfury in forum Fusion 2.5
    Replies: 3
    Last Post: 26th March 2016, 08:25 AM
  2. What kind of color codes are being use when I enter simple number in Calculation?
    By Blizna in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 29th June 2013, 01:47 PM
  3. Mathematic Equation
    By Corlen in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 17th February 2012, 06:42 PM
  4. Maths Equation
    By Dynamite in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 18th March 2010, 12:16 AM
  5. Even spread equation
    By Brandon in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 26th September 2007, 01:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •