Page 1 of 1

NaN ???

Posted: March 30th, 2010, 6:28 am
by SFR75
Hello,

Apparently the latest update for AE CS4 have introduced some rather strange effect - NaN value!
The script which worked fine before now crashes. After some debugging I have found the following.

to reproduce:

3D Solid layer,
property Orientation with just one key
keyInSpatialTangent(1) function returns the following

[0, NaN, 0]

Not only I've never seen NaN value in AE before, there is also no way to work with this value either.
Anybody has any idea what is that, other than a bug ?

Thanks M

Re: NaN ???

Posted: March 30th, 2010, 8:01 am
by Dan Ebberts
Nan is a JavaScript reserved value that indicates that the result is "Not a Number". There are a number of ways you can get this, including trying to divide by zero. I'm not sure why you would get it for your spatial tangent though.

Dan

Re: NaN ???

Posted: March 31st, 2010, 12:55 am
by SFR75
Dan Ebberts wrote:Nan is a JavaScript reserved value that indicates that the result is "Not a Number". There are a number of ways you can get this, including trying to divide by zero. I'm not sure why you would get it for your spatial tangent though.

Dan
Hello Dan,

Yes, I googled it up and I know the meaning of NaN now. Even more, there is some way of handling NaN in AE.

There is a function isNan(x) which tests if x is NaN.
Also there are some numbers like Number.POSITIVE_INFINITY and Number.NEGATIVE_INFINITY - which are also NaNs (despite their Number.. predicate).

Oh well. If anyone has more information on that - thanks for sharing.

M.