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

Re: PATCH: srand returns the seed

Thread Previous | Thread Next
Bo Lindbergh
August 2, 2010 16:53
Re: PATCH: srand returns the seed
Message ID:
Nicholas Clark wrote:
> What I can't work out is whether there is any shortcut way in ANSI C to find
> out whether a value is -0, distinct from 0, short of *printf().

As long as the compiler is sufficiently C99-like:

    fpclassify(value)==FP_ZERO && signbit(value)

/Bo Lindbergh

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