Newgrounds.com — Everything, By Everyone.

Checking login status…

USERNAME:

PASSWORD:

Logging in…

Logged in as:
.
Logging out…
Inbox My Account Log Out


Forum Topic: Nan%

(92 views • 6 replies)

This topic is 1 page long.

<< < > >>
None

TaroNuke

Reply To Post Reply & Quote

Posted at: 10/20/07 08:27 AM

TaroNuke LIGHT LEVEL 15

Sign-Up: 10/05/05

Posts: 118

Is there a way to reference NaN as a value?

E.g. "If (damage = NaN) { //stuff }"?


None

souled

Reply To Post Reply & Quote

Posted at: 10/20/07 08:30 AM

souled NEUTRAL LEVEL 14

Sign-Up: 09/18/06

Posts: 1,521

I'm not sure, well theres no harm trying. Also your example should be:

If (damage == NaN) { //stuff }


None

TaroNuke

Reply To Post Reply & Quote

Posted at: 10/20/07 08:44 AM

TaroNuke LIGHT LEVEL 15

Sign-Up: 10/05/05

Posts: 118

At 10/20/07 08:30 AM, souled wrote: I'm not sure, well theres no harm trying. Also your example should be:

If (damage == NaN) { //stuff }

Whoa, trippy, it totally worked.

I used

if (p1dmg !== "NaN%") {
p1dmgr = p1dmg;
}


None

UnknownFury

Reply To Post Reply & Quote

Posted at: 10/20/07 08:55 AM

UnknownFury EVIL LEVEL 21

Sign-Up: 08/10/05

Posts: 5,054

At 10/20/07 08:44 AM, TaroNuke wrote:
At 10/20/07 08:30 AM, souled wrote: I'm not sure, well theres no harm trying. Also your example should be:

If (damage == NaN) { //stuff }
Whoa, trippy, it totally worked.

I used

if (p1dmg !== "NaN%") {
p1dmgr = p1dmg;
}

if (p1dmg != "NaN%") {
p1dmgr = p1dmg;
}

sort out your syntax ;)


None

TaroNuke

Reply To Post Reply & Quote

Posted at: 10/20/07 09:03 AM

TaroNuke LIGHT LEVEL 15

Sign-Up: 10/05/05

Posts: 118

!== is exactly the same, it works fine.

BY THE WAY:

For anyone who wants to know how to actually address NaN,
the code is:

"Number.NaN"

I found it in the built in index of codes.
Thanks everyone anyway


None

Vengeance

Reply To Post Reply & Quote

Posted at: 10/20/07 09:04 AM

Vengeance EVIL LEVEL 28

Sign-Up: 03/18/05

Posts: 5,051

At 10/20/07 09:03 AM, TaroNuke wrote: !== is exactly the same, it works fine.

It's not exactly the same, it checks for exact equility, ie. doesn't take in datatypes.

========|| WWWWWWWW>[-[Blog] - [Audio] - [Userpage] - [Flash] - [Last.fm]-]<WWWWWWWW ||========

BBS Signature

None

KaynSlamdyke

Reply To Post Reply & Quote

Posted at: 10/20/07 09:07 AM

KaynSlamdyke LIGHT LEVEL 15

Sign-Up: 06/25/04

Posts: 4,145

At 10/20/07 08:30 AM, souled wrote: I'm not sure, well theres no harm trying. Also your example should be:

If (damage == NaN) { //stuff }

if(isNaN(damage)) is a better method...

- Kayn Slamdyke (KSd) - Motorcycle Moderator [[892646]]


All times are Eastern Daylight Time (GMT -4) | Current Time: 01:01 PM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!