develooper Front page | perl.golf | Postings from August 2002

Re: And the winner is...Juho Snellman

Thread Previous | Thread Next
From:
Chris Dolan
Date:
August 7, 2002 22:17
Subject:
Re: And the winner is...Juho Snellman
Message ID:
3D51FEBC.906@clotho.com
Eugene van der Pijll wrote:
> 
> Unfortunately, his solution doesn't seem to work here.
> 
>     $ cat factorial.pl 
>     #!perl -l
>     $_*=$`%9e9,//for~4=~/0*$/..pop;print$`%10
>     $ perl factorial.pl 15
>     0
>     $ perl --version
> 
>     This is perl, v5.6.1 built for alpha-dec_osf
> 
> Can someone explain, please?
> 

It's a 32- vs 64- bit thing.  On a 32-bit box, ~4 == 4294967291 (which 
ends in "1").  On a 64 bit alpha, it is different.

[hris



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