User Tag List

Results 1 to 2 of 2

Thread: Bug with a variable reaching 5.0

  1. #1
    Clicker 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
    Location
    Buffalo, NY
    Posts
    3,283
    Mentioned
    26 Post(s)
    Tagged
    0 Thread(s)

    Bug with a variable reaching 5.0

    In regards to this post:
    http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=246232#Post2462 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.

    Ideas?

    mobichan
    Attached files Attached files

  2. #2
    Clicker Multimedia Fusion 2
    SEELE's Avatar
    Join Date
    Jul 2007
    Location
    Terra australis incognito
    Posts
    1,916
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Bug with a variable reaching 5.0

    Hello again, mobichan

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

    works.


    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, 09:54 PM
  2. Reaching for objects?????
    By Keehan in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 14th May 2011, 08: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, 01:57 PM
  4. TGF_MMF Notion Variable, “Système Variable”.
    By SpringUp in forum File Archive
    Replies: 2
    Last Post: 13th March 2009, 01: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
  •