User Tag List

Results 1 to 2 of 2

Thread: Bug with a variable reaching 5.0

  1. #1

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Buffalo, NY
    28 Post(s)
    0 Thread(s)

    Bug with a variable reaching 5.0

    In regards to this post: 32

    I have a variable that is increased by 0.1 when a condition is met.
    For some reason, when the variable reaches 5 (in the debugger and in a counter I have displaying the variable) actions with the condition var = 5.0 do not get executed. However, if I meet the condition that increases the var one extra time (meaning the var = 5.1), the condition returns true.


    Attached files Attached files

  2. #2
    Clicker Multimedia Fusion 2
    SEELE's Avatar
    Join Date
    Jul 2007
    Terra australis incognito
    0 Post(s)
    0 Thread(s)

    Re: Bug with a variable reaching 5.0

    Hello again, mobichan

    Round(new( "Active" )*10)*0.1 == 5


    This tells us something about the problem

    try changing the number of significant digits right of the decimal place, in the counter, too see whats going on.

    Floating point data-types do not have enough possible configurations to store every possible number, instead they use most of there possible configurations to represent numbers near 0 with ever larger gaps as the number rises.

    This makes digital logical comparisons troublesome :P
    Rounding can fix it as i mentioned above, however i try to use integers when working with complex timing.

    Thanks for the challenge

Similar Threads

  1. Global variable = alterable variable
    By Jibs in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 1st November 2011, 08:54 PM
  2. Reaching for objects?????
    By Keehan in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 14th May 2011, 07:50 AM
  3. Continue scrolling even when reaching frame border
    By Xeeko in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 9th November 2010, 12:57 PM
  4. TGF_MMF Notion Variable, “Système Variable”.
    By SpringUp in forum File Archive
    Replies: 2
    Last Post: 13th March 2009, 12:43 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