I am not sure whether it is a bug or by design, though.

var test0_str:String = "6.30000000000000e+51";
var n0:Number = parseFloat(test0_str);
trace(n0);
trace(n0 == (6.30000000000000e+51));
trace(n0-(6.30000000000000e+51));
// ActionScript 3.0
6.30000000000000e+51
false
1.32922799578491e+36
// ActionScrpt 2.0
6.3e+51
true
0

Decrease one digit:

var test1_str:String = "6.3000000000000e+51";
var n1:Number = parseFloat(test1_str);
trace(n1 == (6.3000000000000e+51));
trace(n1-(6.3000000000000e+51));
// ActionScript 3.0
true
0
_____
elibol wrote:
Those who are interested in helping me verify the problem can run this test
in actionscript 2.0 and again in actionscript 3.0.

var a:String = "6.30000000000000e+51";
var b:String = "23";
var c:Number = parseFloat(a)%parseFloat(b);
trace(c); //outputs 7 in as3, and 18 in as2
trace(6.30000000000000e+51%23); // outputs 18 in both as2 and 3

Good luck,
--
Fumio Nonaka
mailto:[EMAIL PROTECTED]
http://www.FumioNonaka.com/
My books<http://www.FumioNonaka.com/Books/index.html>
Flash community<http://F-site.org/>

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to