Re: [Flashcoders] Compare Decimal Point Value?

2006-12-06 Thread T. Michael Keesey
In Flash 9, I get this for the traces: 2.3 0.2998 0.3 false false true Good old-fashioned floating point precision error. Instead of testing if they are equal, You could test if the difference between them is very small, e.g.: trace(Math.abs(num2 - num3) 0.1); // true On

RE: [Flashcoders] Compare Decimal Point Value?

2006-12-06 Thread Doug Coning
Of T. Michael Keesey Sent: Wednesday, December 06, 2006 3:23 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] Compare Decimal Point Value? In Flash 9, I get this for the traces: 2.3 0.2998 0.3 false false true Good old-fashioned floating point precision error. Instead

RE: [Flashcoders] Compare Decimal Point Value?

2006-12-06 Thread Steven Sacks | BLITZ
Have you tried casting them as Strings and comparing those? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of T. Michael Keesey Sent: Wednesday, December 06, 2006 12:23 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] Compare Decimal

RE: [Flashcoders] Compare Decimal Point Value?

2006-12-06 Thread Steven Sacks | BLITZ
Math.round(myNum * 10); :) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Doug Coning Sent: Wednesday, December 06, 2006 12:32 PM To: Flashcoders mailing list Subject: RE: [Flashcoders] Compare Decimal Point Value? Is there a better way

RE: [Flashcoders] Compare Decimal Point Value?

2006-12-06 Thread Doug Coning
: [Flashcoders] Compare Decimal Point Value? Math.round(myNum * 10); :) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Doug Coning Sent: Wednesday, December 06, 2006 12:32 PM To: Flashcoders mailing list Subject: RE: [Flashcoders] Compare

Re: [Flashcoders] Compare Decimal Point Value?

2006-12-06 Thread T. Michael Keesey
: [Flashcoders] Compare Decimal Point Value? In Flash 9, I get this for the traces: 2.3 0.2998 0.3 false false true Good old-fashioned floating point precision error. Instead of testing if they are equal, You could test if the difference between them is very small, e.g.: trace(Math.abs

Re: [Flashcoders] Compare Decimal Point Value?

2006-12-06 Thread Yehia Shouman
. Michael Keesey Sent: Wednesday, December 06, 2006 3:23 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] Compare Decimal Point Value? In Flash 9, I get this for the traces: 2.3 0.2998 0.3 false false true Good old-fashioned floating point precision error. Instead