factorial: Calculates the n:th factorial

Description Usage Arguments Value Author(s) Examples

View source: R/factorial.R

Description

Calculates n!, i.e. the n:th factorial by calling gamma(n+1) and first asserting that n is an integer. The largest factorial that can be calculated is 170!.

Usage

1

Arguments

x

An integer

.

Value

Returns a number (not an integer since integers can not store large enough values).

Author(s)

Henrik Bengtsson

Examples

1
2
  factorial(4) == 24
  # [1] TRUE

HenrikBengtsson/R.basic documentation built on May 6, 2019, 11:51 p.m.