Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Dangerous Names

by wol (Hermit)
on Dec 23, 2008 at 17:29 UTC ( [id://732330]=note: print w/replies, xml ) Need Help??


in reply to Dangerous Names

Hang on, I think I'm getting it...

"Nan" is "not a number", and is treated as such.

However, "not a number" is not a number, so is treated as zero.

No - it's slipping away again...

--
use JAPH;
print JAPH::asString();

Replies are listed 'Best First'.
Re^2: Dangerous Names
by gwadej (Chaplain) on Dec 23, 2008 at 18:44 UTC

    How about...

    "Nan" is a string representation of the floating point literal NaN. Like all string representations of floating point numbers it may be treated as it's numeric value.

    However, "not a number" is a non floating point string, so is treated as 0.

    Gaak! Trying to say this succinctly is a great way to twist your brain into knots.

    Disclaimer: IANALL, but I've played one in several companies.<grin/>

    G. Wade

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://732330]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (2)
As of 2024-04-24 17:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found