Note: After 171>, the script just says "inf", so I cut it off at 170.#!/usr/bin/perl use strict; use warnings; sub fact { my $n = shift; my $result = 1; foreach my $i (1 .. $n) { $result *= $i; } $result; } foreach my $i (1 .. 170) { print "$i! = ", fact($i), "\n"; }
In reply to Re: Floating point factorials
by Khen1950fx
in thread Floating point factorials
by Microcebus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |