Chat with us, powered by LiveChat

Bug in Flash Player 1/Math.abs(0) is -Infinity

October 26th, 2011 by Timothy Loginov

AnyChart Team has found in Flash Player a very weird bug that doesn’t manifest itself in the Debug version of Flash Player, but ruins math in the regular version, so we had to debug it in the non-debug version: using ExternalInterface and JavaScript console.

Bug description

In the regular version of Flash Player the following expression:


is evaluated as -Infinity, but in the Debug version it is (as anyone expects): Infinity


Here is a sample code you can use to reproduce this issue:

package {
    import flash.display.Sprite;
    import flash.external.ExternalInterface;

    public class MagicWorld extends Sprite {
        public function MagicWorld() {
  "alert", "1/Math.abs(0) = " + (1/Math.abs(0)).toString());

As soon as you have done this — compile and run the sample in the Debug and Regular versions, and you will see the difference.

The bug has been reported to Adobe: Bug#3011557
The test sample:

No Comments Yet