Math operations with normal numbers, such as 0/0 and Math.sqrt(-1), can also
produce NaN. 

According to the ECMA-262 spec, NaN is a Number, despite its name meaning
"Not a Number":

"4.3.20 Number Type
The type Number is a set of values representing numbers. In ECMAScript, the
set of values represents the double-precision 64-bit format IEEE 754 values
including the special "Not-a-Number" (NaN) values, positive infinity, and
negative infinity."

The concept of NaN dates back at least to the IEEE 754 specification for
binary floating-point arithmetic.

- Gordon


-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 19, 2005 4:09 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Simple arithmetic - resolved



> Question - shouldn't this have thrown an error, since I was casting
the
> non-number variable as a number in the parameter statement, as 
> varX:Number?

Flash is not checking types runtime, only compile time. And compile time
everything is programmed right

>trace(!isNaN(NaN));

NaN is kind of its own type and is usually the result of an equation
with a string or some other non-numeric type.


Greetz Erik


-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of JesterXL
Sent: maandag 18 april 2005 21:53
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Simple arithmetic - resolved


A number is not a number?  wtf, lol!

trace(!isNaN(NaN)); // false

...crud, that means it is... but how can a number that's not a number be
a number?

I'm confused now...



 
Yahoo! Groups Links



 





 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to