Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Infinity recognized as number

by shemp (Deacon)
on Nov 22, 2002 at 18:08 UTC ( [id://215212]=note: print w/replies, xml ) Need Help??


in reply to Infinity recognized as number

Nothing to do with infinify, rather a comment on perls numeric interpretation of scalars.
using the addition operator "+", perl will use its numeric interpretation of both operands.
1 evaluates to 1 (like you'd expect)
"Infinity" evaluates to 0 ("zero")
so the addition results in 1

in general, when perl needs a numeric interpretation of a scalar, the value is the value of the maximal length numeric substring that starts at the first character of the scalar.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-04-25 10:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found