Apologies if this is common knowledge, but I've just come across a huge maths 
problem in Flash... as I've mentioned before I'm working on an online trading 
system where real people make or lose real money, sometimes a huge amount of 
it, so this isn't funny...

Here's some simple arithmetic..

var a:Number = 171.9;
var b:Number = 172.2;
var c:Number;
c = b - a;

Now an elementary school kid would probably give the answer 0.3
Unfortunately Flash has other ideas...

trace(c);
0.299999999999983

I'm a bit shocked to be honest. Am I imagining it? 

I'm aware that AS3 introduces proper integers and floats for arithmetic, but 
that doesnt address my problem now. 

What says the wise Chattyfig community??

_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!


_______________________________________________
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