Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: OEO, a zero that evaluates to true?

by princepawn (Parson)
on Jan 08, 2002 at 13:51 UTC ( #137082=note: print w/replies, xml ) Need Help??


in reply to OEO, a zero that evaluates to true?

I'm surprised that "0" is false...

I added in checks for floating point zero as well...

#!perl -w use strict; my $oero = "0E0"; my $zero = "0"; my $foat = 0.0; print "oero ($oero) true\n" if($oero); print "oero ($oero) defined\n" if(defined($oero)); print "zero ($zero) true\n" if($zero); print "zero ($zero) defined\n" if(defined($zero)); print "foat ($zero) true\n" if($foat); print "foat ($zero) defined\n" if(defined($foat)); print "zero eq oero\n" if ($oero eq $zero); print "zero == oero\n" if ($oero == $zero); print "oero+1: ", $oero+1, "\n"; print "oero+zero: ", $oero+$zero, "\n"; print "oero+oero: ", $oero-$oero, "\n";

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://137082]
help
Chatterbox?
[LanX]: strangely you can't disable the XP nodelet
[LanX]: But you can use CSS to hide it
[LanX]: and disoplay the data permanently in your peronal nodelet
[marinersk]: I saw that you could post it on the Personal Nodelet, but you have to provide the content also. No way to auto-populate it. Not that this would solve my distraction problem...
[LanX]: there are template variables to "Auto-populate" it
[marinersk]: Yeah, someday I might become interested enough to poke around PerlMonks more internally. Most of the fancy stuff is way down on my to do list.
[LanX]: Yeah ...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2017-05-29 14:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?