Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Factorial Problem

by tadman (Prior)
on Jun 24, 2002 at 18:05 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (7)
As of 2024-04-18 03:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found