User Tag List

Results 1 to 5 of 5

Thread: Get more precise random float

  1. #1
    Clicker 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)

    Join Date
    Nov 2012
    Posts
    121
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Get more precise random float

    Hey.

    Is it possible to get a random float number with more than 6 digits after decimal point (tested in MT Random obj)?

    Greets,

    2xD

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    Yes!
    Are you using a counter to display the value?
    If so, make sure you have both checked under counter properties:
    -number of significant digits (your preference)
    -number of digits after decimal point (more than 6, up to 15)

  3. #3
    Clicker 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)

    Join Date
    Nov 2012
    Posts
    121
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okay, this one seems to work. But how to get a random value from a set float (so that the digits after decimal point are also random)?

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    You want a random number of decimal positions?

    i.e. like this?
    Random(10000.0 ) / ( RRandom(1.0, 100.0 ) * 1.0 )

    But if you display it in a counter, you're anyway going to have a fixed number of positions (additional 0's) on the right

  5. #5
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleUnicode Add-onInstall Creator Pro
    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)

    Join Date
    Jul 2006
    Posts
    574
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    You'll need to take floating point precision into account. For instance if you are working with a small number like 1.0 you will be able to use 15 of the decimal numbers. However the higher the value the less precision there will be with the decimal points. So you wont be able to work with 15 digits on the right of the point and 15 on the left of the point. If you open up windows calculator you'll see the limitations for yourself. If you need something like this you could always store the decimal in another value and then concatenate the 2 values for a text representation.

Similar Threads

  1. Allow me to be more precise! Going High Res !!!
    By Aloan in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 13th January 2016, 02:23 PM
  2. MT Random Object Float Bug
    By AyreGuitar in forum iOS Export Module Version 2.0
    Replies: 0
    Last Post: 20th August 2012, 03:03 PM
  3. Which is the better way to make precise calculations?
    By Ls2 in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 14th December 2011, 12:20 AM
  4. Precise collision detection...
    By RGBreality in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 7th July 2010, 04:00 AM
  5. More precise timer?
    By paulvandykx in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 3rd June 2007, 10:39 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
  •