develooper Front page | perl.perl5.porters | Postings from July 2010

RE: [perl #76756] PATCH: srand returns the seed

Thread Previous | Thread Next
Jan Dubois
July 28, 2010 12:40
RE: [perl #76756] PATCH: srand returns the seed
Message ID:
On Wed, 28 Jul 2010, Zefram wrote:
> Jan Dubois wrote:
> >Well, you _could_ add a special case to the string comparison:
> That would be a mess.  The better solution is for negative zero to
> stringify as "0".


  Or add a pragma to tree "-0" as false in boolean context:

    use feature "minus_zero_is_false";
    print "Yes" if "-0";

  would then not print anything.

I'm more and more convinced that using a floating point number in
boolean context is simply something you should not be doing for
similar reasons that you generally are not comparing floating point
numbers for equality.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About