User Tag List

Results 1 to 7 of 7

Thread: What'd I do wrong? Suddenly 8.12 displays as 8.119999999999999

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleSWF Export Module

    Join Date
    Jul 2010
    Location
    Belgium
    Posts
    244
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    What'd I do wrong? Suddenly 8.12 displays as 8.119999999999999

    This is what happened. I was changing the same number on each line on the event list editor like this :

    * id=5
    - set AltValA to 5.12

    * id=6
    - set AltValA to 6.32

    Like this, always a double digit behind the point.
    Now when I try:

    *id=7
    - set AltValA to 8.12

    I get
    *id=7
    - set AltValA to 8.119999999999999


    What button did I accidently pushed? What'd I do? Any help is greatly appreciated

  2. #2
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)

    Join Date
    Dec 2013
    Posts
    121
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have no idea what causes this problem i also get the doing some calculations.
    Here are some handy things to know:

    This will Round the number up or down depending on the size of the decimal.
    Round(AltValA)
    This will Always round the decimal up:
    Ceil(AltValA)
    This will alway round the decimal down:
    Floor(AltValA)

    You could try to set the value to for example 812 and then when display the value divide it by 100

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleSWF Export Module

    Join Date
    Jul 2010
    Location
    Belgium
    Posts
    244
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks for replying. I do know about these, but I'd rather not start using a workaround mid-project, especially when it worked all along.
    I must've pushed something I shouldn't have :s

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,350
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    I don't think you have pushed any wrong buttons. It simply has to do with how Float works. Check out Yves' reply in this thread: http://community.clickteam.com/threads/80877-Bug-Float-values-are-slightly-off?highlight=float

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleSWF Export Module

    Join Date
    Jul 2010
    Location
    Belgium
    Posts
    244
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    So it's the nature of floats in all runtimes, I get that. But why does it seem to work for all numbers under 8. It's only when it goes above 8, the numbers go funky.
    Or is that just a coincidence?

    I attached a small example of what I mean. I tried to set AltVal A of ActiveII to 8.55. ActiveI with 1.55 works fine.

    floats.mfa

  6. #6
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It only happens for certain numbers because of how computers represent numbers internally in binary. Think of the fraction 1/3 as a good example for how we count numbers - we write it as 0.33333 in decimal because there's no perfect way to represent one exact third in that system, and so we make an approximation. Computers have to make small approximations in the same way for certain floating point numbers.

    There's a site that explains more here, it's a decent read: http://floating-point-gui.de/basic/

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleSWF Export Module

    Join Date
    Jul 2010
    Location
    Belgium
    Posts
    244
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Wow, that page has my exact questions in chronological order, with my favourite answer being "It’s not stupid, just different"

    Superthanks for all the info!!

Similar Threads

  1. Replies: 11
    Last Post: 22nd June 2015, 01:44 PM
  2. Lives Object displays for P2
    By N64Mario in forum Fusion 2.5
    Replies: 0
    Last Post: 13th February 2014, 07:20 PM
  3. iOS Simulator only displays in Portrait?
    By WhatPixelYouOn in forum iOS Export Module Version 2.0
    Replies: 6
    Last Post: 30th October 2012, 12:18 PM
  4. BUG - Dialog Box List displays wrong
    By aidmm in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 23rd March 2007, 03:12 PM
  5. BUG - Dialog Box List displays wrong
    By aidmm in forum File Archive
    Replies: 0
    Last Post: 20th March 2007, 09:38 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
  •