User Tag List

Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 21

Thread: Setting a negative value to 0

  1. #1
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jul 2006
    Location
    Denmark
    Posts
    1,812
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Setting a negative value to 0

    Anyone knows a mathematical expression that sets a negative value to zero?

    Thanks in advance!

  2. #2
    Clicker Fusion 2.5 DeveloperSWF Export ModuleInstall Creator Pro

    Join Date
    Jun 2006
    Location
    France
    Posts
    1,266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Setting a negative value to 0

    Either

    if $counter < 0 then $counter=0

    or

    Min($counter,0)

  3. #3
    No Products Registered

    Join Date
    Aug 2006
    Location
    England
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Setting a negative value to 0

    or

    (x + Abs(x))/2

  4. #4
    No Products Registered

    Join Date
    Jun 2006
    Posts
    150
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Setting a negative value to 0

    or

    x*0 ?

    <img src="/center/images/graemlins/smile.gif" alt="" />

  5. #5
    No Products Registered

    Join Date
    Aug 2006
    Location
    England
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Setting a negative value to 0

    lol, yeah I guess that would do it too :P I assume he wants to preserve any possitive value that the counter might have had.

  6. #6
    No Products Registered

    Join Date
    Jun 2006
    Posts
    150
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Setting a negative value to 0

    []lol, yeah I guess that would do it too :P I assume he wants to preserve any possitive value that the counter might have had. [/]
    Ah yeah, he might want that <img src="/center/images/graemlins/smile.gif" alt="" />
    Guess he could do max(0, min(x, MAX_VALUE))

  7. #7
    No Products Registered

    Join Date
    Aug 2006
    Location
    Westcountry, UK
    Posts
    862
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Setting a negative value to 0

    or Min($counter,5^3+5-abs(floor(-260.34)/2)) <img src="/center/images/graemlins/laugh.gif" alt="" />

  8. #8
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jul 2006
    Location
    Denmark
    Posts
    1,812
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Setting a negative value to 0

    []or

    x*0 ?

    <img src="/center/images/graemlins/smile.gif" alt="" /> [/]
    That'd make it instantly zero. I want it to be zero only when it gets at a negative value WITHOUT using any events. Only mathematically expressions.
    (And it's not a counter, it's a global value, so the max() / min() thing won't work.)

  9. #9
    No Products Registered

    Join Date
    Aug 2006
    Location
    England
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Setting a negative value to 0

    why not just set it's minimum value to 0 in it's properties then ?

    Edit: oh sorry, not a counter :P

  10. #10
    No Products Registered

    Join Date
    Aug 2006
    Location
    The Netherlands
    Posts
    80
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Setting a negative value to 0

    +Always
    -Set Global Value to Max(0,Global Value)

    The function Max(value,value) always chooses the highest value out of two values, so if the Global Value is positive, the Global Value itself is the highest value. If it is negative, the 0 will be the highest value.

Page 1 of 3 1 2 3 LastLast

Similar Threads

  1. Negative Numbers bug
    By ffomega in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 5th November 2010, 12:20 AM
  2. Negative fixed values
    By Nifflas in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 2nd September 2010, 09:12 AM
  3. Negative to posetive
    By kjellm87 in forum The Games Factory 2 - Technical Support
    Replies: 5
    Last Post: 15th January 2008, 09:12 PM
  4. Negative Gravity
    By BREK in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 7th December 2007, 03:21 PM

Posting Permissions

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