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

[perl #61448] "sort { $a <=> $b }" silent on <=> returning non-number

Thread Previous
Father Chrysostomos via RT
October 13, 2011 08:25
[perl #61448] "sort { $a <=> $b }" silent on <=> returning non-number
Message ID:
On Wed Dec 17 14:35:52 2008, wrote:
> # I don't know how else to generate a NaN in ActivePerl.
> my $nan = unpack 'd', scalar reverse pack 'H*', '0x7FFFFFFFFFFFFFFF';

You can use sin(9**9**9), which produces a negative nan. -sin(...)
produces a positive nan.  But in 32-bit ActivePerl, nan breaks if you
try to do anything with it.

(See also <>).

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