Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Factorial Problem

by tadman (Prior)
on Jun 24, 2002 at 18:05 UTC ( #176873=note: print w/replies, xml ) Need Help??


in reply to factorialmath.

Since this clearly isn't homework (cough), here's an idea of how to solve the problem:
#!/usr/bin/perl package F;sub TIESCALAR{bless[],pop} sub FETCH{$v=$n=pop()->[$|];$v*=--$n while(1<$n);$v}sub STORE{shift()->[0 ]=pop}tie($f,F);$f=pop;print$f,$/,$@

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://176873]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2023-09-25 15:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?