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