FAC

Contents


fac calculates an integer's factorial.

 

Syntax

 

   fac(ent_exp)

 

Parameters

Element

Description

Restrictions

ent_exp

Whole Number

0 <= ent_exp <= 58

 

Examples

   SEIZE = fac(16) / fac(15)
   CNP1 = fac(N) / (fac(P) * fac(N-P))

 

Description and Comments

fac(N) returns N*(N-1)*(N-2)* ... *2*1

Conventionally, fac(0) = 1.

The type of result is Integer or Decimal depending on whether the result is less or greater than 2^31-1.

 

Associated Errors

Error

Description

ERMODE (10)

ent_exp is not numeric.

ERDOM (50)

ent_exp is outside of the domain (not an integer, for example).

ERHUGE (13)

ent_exp is greater than or equal to 58.

 

Associated Keywords

CNP - ANP


CONTENTS


Copyright © Sage 1999 - 2007