Skip to content
Prev 177987 / 398502 Next

large factorials

You don't say what the error was, for the R factorial function,
but it is probably irrelevant for your question.

Factorials get to be big numbers rather quickly and unless you
are using a program that does arbitrary precission arithmetic
you will quickly exceed the precission limits, for storing a number.
If you have Maple, do 170! and count the number of digits in the
result. You will see what I mean.

There are some tricks when working with large factorials, depending
on what you are doing with them. I'd first try the log factorial function
in R I think its called lfactorial. Just do a ?factorial and you'll find
documentation. If this doesn't work, for you, repost with a clear
description of what you're trying to do and someone may be able
to help.

Murray M Cooper, Ph.D.
Richland Statistics
9800 N 24th St
Richland, MI, USA 49083
Mail: richstat at earthlink.net

----- Original Message ----- 
From: "molinar" <sky2k2 at hotmail.com>
To: <r-help at r-project.org>
Sent: Wednesday, April 22, 2009 3:21 PM
Subject: [R] large factorials