User Tag List

Page 2 of 3 FirstFirst 1 2 3 LastLast
Results 11 to 20 of 22

Thread: No correct float calc although multiplied by 1.0 ?

  1. #11
    No Products Registered

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

    Re: No correct float calc although multiplied by 1

    Quote Originally Posted by Jamie
    Jeff is the US sales manager, not a programmer- I'm not sure if him not knowing is anything to about.
    I also asked other people in gwerdychat about it (the people with the crazy stars next to it). Didn't get any anwers.

    To be completely honest. The emotion "" was not really the part of my post i wanted you to take note on. But you can argue with me if you like.

  2. #12
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    Tiles's Avatar
    Join Date
    Jun 2006
    Posts
    1,359
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: No correct float calc although multiplied by 1

    Sorry to dig this out again. But i get mad here.

    Why does 1.0*(value counter 1)/(value counter 2) result in 0?

    Why does 1.0*4/59 result in 0?

    What can i do to convince those goddamn counters to calculate with floats?

  3. #13
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jul 2006
    Posts
    2,023
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: No correct float calc although multiplied by 1

    From what I remember, build 247 has a bug which is fixed in 248

  4. #14
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    Tiles's Avatar
    Join Date
    Jun 2006
    Posts
    1,359
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: No correct float calc although multiplied by 1

    I use Build 248 now. But i cannot convince the counter to show a float result. It shows zero

  5. #15
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jul 2006
    Posts
    2,023
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: No correct float calc although multiplied by 1

    try 1.0*4.0/59.0

  6. #16
    No Products Registered

    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    1,141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: No correct float calc although multiplied by 1

    or (1.0*4)/59

  7. #17
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: No correct float calc although multiplied by 1

    I think in MMF division has priority, so 1.0*4/59 is equal to (1.0)*(4/59). Technically they should be equal priority, and mathematically there is no difference between doing the division first and doing it in the same pass as multiplication, but because MMF has two kinds of division (integer divide and floating point divide) the order of operations can affect your result.

  8. #18
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    Tiles's Avatar
    Join Date
    Jun 2006
    Posts
    1,359
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: No correct float calc although multiplied by 1

    I got it working. For this time.

    4*1.0/59 gives my needed floating point value. Don't ask me why. And from what i can read from the answers i am not the only one :grin:

    Please Please Please give us another solution for floats. The current method is try and pray. And that's nasty.

  9. #19
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: No correct float calc although multiplied by 1

    I already explained why, but possibly not clearly:
    1: In MMF, integer/integer (eg 3/4) rounds down to give an integer answer (in this case 0.75 rounds to 0).
    2: You can convert an integer to a floating point (float) value by multiplying it by 1.0.
    3: In MMF, division is done before multiplication (instead of in the order they appear)
    "3" means that 1.0*4/59 doesn't work, because it does (4/59) first, rounding down to an integer because both numbers were integers, instead of doing (1.0*4) first, and getting a float, then doing 4.0/59, and getting the expected float answer (no rounding).
    4*1.0/59 works, because it does (1.0/59) first.

  10. #20
    Forum Moderator Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    Sphax's Avatar
    Join Date
    Jun 2006
    Location
    Paris, France
    Posts
    4,454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: No correct float calc although multiplied by 1

    As described just above by Dynasoft, to illustrate:

    For MMF2: 4*1.0/59 means 4*(1.0/59) so you got a float because you divide by 59 the float 1.0.

Page 2 of 3 FirstFirst 1 2 3 LastLast

Similar Threads

  1. Calc text rect object
    By richardh in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 1st July 2012, 05:17 PM
  2. Scaling Calc.
    By Chrille in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 18th April 2012, 02:35 PM
  3. some confusion about things in the expression calc
    By ZayLong in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 9th December 2010, 12:33 PM
  4. player/enemy distance calc
    By arfa in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 20th October 2010, 12:56 PM
  5. Request - Excel or OpenOffice Calc Extension
    By droberson in forum Extension Development
    Replies: 10
    Last Post: 4th August 2008, 06:30 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
  •