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

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/perl5db.pl:638] 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?

      Strange...

      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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2017-10-23 23:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (285 votes). Check out past polls.

    Notices?