develooper Front page | perl.perl5.porters | Postings from October 2003

0e0?

From:
schwern
Date:
October 10, 2003 11:27
Subject:
0e0?
Message ID:
20031010112629.T10706@ttul.org
From blead's perlsyn:

  Note that while 0, 0.0 and C<'0'> are false, C<'0.0'> and C<'0e0'> are
  true, but evaluate to 0 in a numeric context.

What's 0e0 all about?  Is that the fabled "zero but true"?  If so...

--- pod/perlsyn.pod	2003/10/10 18:25:26	1.1
+++ pod/perlsyn.pod	2003/10/10 18:25:46
@@ -106,8 +106,9 @@
 The number 0, the strings C<'0'> and C<''>, the empty list C<()>, and
 C<undef> are all false in a boolean context. All other values are true.
 
-Note that while 0, 0.0 and C<'0'> are false, C<'0.0'> and C<'0e0'> are
-true, but evaluate to 0 in a numeric context.
+Note that while 0, 0.0 and C<'0'> are false, C<'0.0'> and C<'0e0'>
+(aka "zero but true") are true, but evaluate to 0 in a numeric
+context.
 
 =head2 Statement Modifiers
 




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About