Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re^2: Infinity and Inf?

by LanX (Bishop)
on Aug 31, 2010 at 17:55 UTC ( #858193=note: print w/replies, xml ) Need Help??

in reply to Re: Infinity and Inf?
in thread Infinity and Inf?

> It's not a symbol (not a constant or function).

hmm strange:

DB<8> print 5+Inf inf DB<9> use strict;print 5+Inf Bareword "Inf" not allowed while "strict subs" in use at (eval 13)[/us +r/share/perl/5.10/] line 2.

Cheers Rolf

Replies are listed 'Best First'.
Re^3: Infinity and Inf?
by ikegami (Pope) on Aug 31, 2010 at 18:02 UTC
    How is that weird? Barewords are autoquoted when strict doesn't prevent it.
    $ perl -E'$x=abc; say $x' abc $ perl -E'$x=Inf; say $x' Inf

    Nothing special there. Like I said, only its numification is special.

    $ perl -E'$x=Inf; say 0+$x' inf
      > How is that weird?
      DB<10> print 5+abc 5 DB<11> print 5+Inf inf

      So Inf is a kind of dualvar but not a constant?


      Cheers Rolf

        You find it strange that "abc" numifies to zero?

        So Inf is a kind of dualvar but not a constant?

        No. Like I said in my last two posts, "Inf" (numifies to inf) is a string just like "5" (numifies to 5), "abc" (numifies to 0) and "5E1" (numifies to 50).

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://858193]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2018-05-24 17:30 GMT
Find Nodes?
    Voting Booth?