Skip navigation
Станислав Смагин
Currently Being Moderated

The problem with multiplication by a fractional number (iphone 3gs)

Nov 3, 2011 4:08 AM

Hi

 

I have a loop in the event handler enterframe. Inside the loop — the multiplication by a fractional number.

 

for (var i:int = 0; i < 200; i++){

var n:Number = 10 * 0.12;

}


As a result, on the iphone 3gs very fast memory is wasted. About 20 KB per second. After some time the memory is reset and starts again to grow. Each time you reset FPS jumps, it is not suitable for my game. When multiplied by an integer, then there is no problem.

 


Does anyone had a similar problem? Is it possible to optimize this operation?

 

P. S. I try Air 2.6, 2.7 and 3. This is a problem everywhere.

 
Replies
  • Currently Being Moderated

    I assume this is an example and you're not really just settting n = 1.2 two hundred times per enterFrame.

     

    As this question is a year old, I'll ask: does the problem still happen today with the latest AIR builds?

     

    If so, would you mind entering this as a bug over at bugbase.adobe.com?  Please post back with the bug number and I'll forward along internally.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points