define epsilon and check if abs(x-y)<epsilon

"Boon Chew" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]

How do you usually deal with the loss in precision (a bit oxymoron since 
floating point can't be exactly represented) when converting a floating 
point string to a number?

var s:String = "952.86";
var i:Number = parseFloat(s);
trace(i);
trace(i - 952.86);   // Not zero!


- boon




---------------------------------
Yahoo! Mail
Bring photos to life! New PhotoMail  makes sharing a breeze.
_______________________________________________
[email protected]
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



_______________________________________________
[email protected]
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