]
> > [mailto:[EMAIL PROTECTED] On Behalf 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:
> >
om: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf 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.29
ct: 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 of testing
if they are equal, You could test if the difference between them is
very small, e.g.:
trace(Ma
ist
Subject: RE: [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
>
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 V
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:
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 of
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 12/6/
8 matches
Mail list logo