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

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

Thread Previous | Thread Next
From:
Zefram
Date:
August 2, 2010 11:11
Subject:
Re: [perl #76756] PATCH: srand returns the seed
Message ID:
20100802181146.GG10983@lake.fysh.org
Jan Dubois wrote:
>I don't see agreement on what the bug is anymore:
>
>a) Should -0 always be TRUE, even when it has never been stringified, or
>b) Should -0 always be stringified as "0" and therefore always be FALSE?

Either would be self-consistent, and thus make an improvement on the
bug.  Of the two options, I have a distinct preference for b, because
it adds the further consistency that any flavour of pure numeric zero
is consistently false.  Perl makes it difficult to predict which zero
you'll get, and using numeric values directly as truth values is common,
so this is a very useful thing to be consistent about.

-zefram

Thread Previous | Thread Next


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