Professional Web Applications Themes

ERRORS in calculations in AS3 - Macromedia Flash Player

I have serios errors in calculation when my application compiled as ActionScript3. When it compiled as AS2 - no errors. These errors (For AS3) is present in all versions of Flah Player 9 which I has checked. Please anyone try to compile this code as AS3 (Maybe I've got just my personal problems with my software/hardware): ////// ActionScrip3 (ERRORS) // var f_Result:Number; f_Result = 456.2225 - 332.8892; trace(f_Result); // 123.33330000000001 (Must be 123.3333) f_Result = Math.sin(Math.PI/6); trace(f_Result); // 0.49999999999999994 (Must be 0.5) f_Result = Math.cos(Math.PI/3); trace(f_Result); // 0.5000000000000001 (Must be 0.5) // //////// END ////////// ActionScrip2 (NO errors) // var ...

  1. #1

    Default ERRORS in calculations in AS3

    I have serios errors in calculation when my application compiled as
    ActionScript3.
    When it compiled as AS2 - no errors. These errors (For AS3) is present in all
    versions of Flah Player 9 which I has checked.

    Please anyone try to compile this code as AS3 (Maybe I've got just my personal
    problems with my software/hardware):


    ////// ActionScrip3 (ERRORS)
    //
    var f_Result:Number;

    f_Result = 456.2225 - 332.8892;
    trace(f_Result); // 123.33330000000001 (Must be 123.3333)

    f_Result = Math.sin(Math.PI/6);
    trace(f_Result); // 0.49999999999999994 (Must be 0.5)

    f_Result = Math.cos(Math.PI/3);
    trace(f_Result); // 0.5000000000000001 (Must be 0.5)
    //
    //////// END



    ////////// ActionScrip2 (NO errors)
    //
    var f_Result:Number;

    f_Result = 456.2225 - 332.8892;
    trace(f_Result); // 123.3333 (OK)

    f_Result = Math.sin(Math.PI/6);
    trace(f_Result); // 0.5 (OK)

    f_Result = Math.cos(Math.PI/3);
    trace(f_Result); // 0.5 (OK)
    //
    //////// END

    Frstorm Guest

  2. #2

    Default Re: ERRORS in calculations in AS3

    Hi Frstorm,

    I compiled in AS3 with no errors. The Output is:

    123.33330000000001
    0.49999999999999994
    0.5000000000000001


    ////// ActionScrip3 (ERRORS)
    //
    var f_Result:Number;

    f_Result = 456.2225 - 332.8892;
    trace(f_Result); // 123.33330000000001 (Must be 123.3333)

    f_Result = Math.sin(Math.PI/6);
    trace(f_Result); // 0.49999999999999994 (Must be 0.5)

    f_Result = Math.cos(Math.PI/3);
    trace(f_Result); // 0.5000000000000001 (Must be 0.5)
    //
    //////// END

    Darren Guest

  3. #3

    Default Re: ERRORS in calculations in AS3

    I apologize, although I do not receive any compilation errors, I do see that
    the Math is not computing correctly. I will submit this as a bug.

    Please send me your personal information (full name, email) through the ?Send
    Private Message? link in the left panel of the forum page? I would like to open
    a case for you.


    Darren Guest

Similar Threads

  1. Calculations in a form
    By Kathy_Neal@adobeforums.com in forum Adobe Acrobat Macintosh
    Replies: 2
    Last Post: December 8th, 02:10 PM
  2. Birthdate Calculations
    By LivingstoneTechie in forum Coldfusion - Advanced Techniques
    Replies: 2
    Last Post: April 21st, 06:17 PM
  3. PDF Forms - Calculations
    By Kevin_Jensen@adobeforums.com in forum Adobe Acrobat Windows
    Replies: 1
    Last Post: April 28th, 01:39 AM
  4. Objc Nubie: Errors Errors Errors
    By John in forum Mac Programming
    Replies: 8
    Last Post: February 16th, 07:30 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139