4,494
edits
(Created page with "{{Built-in|Factorial|!}} is a monadic scalar function which gives the factorial of a non-negative integer. Factorial shares the glyph <sour...") |
m (Text replacement - "http://help.dyalog.com" to "https://help.dyalog.com") Tags: Mobile edit Mobile web edit |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
{{Built-in|Factorial|!}} is a [[monadic]] [[scalar function]] which gives the [[wikipedia:factorial|factorial]] of a non-negative integer. Factorial | {{Built-in|Factorial|!}} is a [[monadic]] [[scalar function]] which gives the [[wikipedia:factorial|factorial]] of a non-negative integer. Factorial takes its [[glyph]] <source lang=apl inline>!</source> from [[Comparison_with_traditional_mathematics#Prefix|traditional mathematics]] but, like all [[monadic function]]s, takes its argument on the right <source lang=apl inline>!Y</source> instead of traditional mathematics' <math>Y!</math>. It shares the glyph with the dyadic arithmetic function [[Binomial]]. | ||
== Examples == | == Examples == | ||
Line 14: | Line 14: | ||
== Extended definition == | == Extended definition == | ||
In multiple implementations, this function has an extended definition using the [[wikipedia:Gamma function|Gamma function]] Gamma(n), so that it is defined for real and [[complex]] numbers. Because Gamma(n) equals (n-1)!, <source lang=apl inline>!Y</source> is defined as Gamma(Y+1). | In multiple implementations, this function has an extended definition using the [[wikipedia:Gamma function|Gamma function]] <math>\Gamma(n)</math>, so that it is defined for real and [[complex]] numbers. Because <math>\Gamma(n)</math> equals <math>(n-1)!</math>, <source lang=apl inline>!Y</source> is defined as <math>\Gamma(Y+1)</math>. | ||
<source lang=apl> | <source lang=apl> | ||
Line 43: | Line 43: | ||
=== Documentation === | === Documentation === | ||
* [ | * [https://help.dyalog.com/latest/#Language/Primitive%20Functions/Factorial.htm Dyalog] | ||
* [http://microapl.com/apl_help/ch_020_020_250.htm APLX] | * [http://microapl.com/apl_help/ch_020_020_250.htm APLX] | ||
* [https://www.jsoftware.com/help/dictionary/d410.htm J Dictionary], [https://code.jsoftware.com/wiki/Vocabulary/bang NuVoc] | * [https://www.jsoftware.com/help/dictionary/d410.htm J Dictionary], [https://code.jsoftware.com/wiki/Vocabulary/bang NuVoc] | ||
{{APL built-ins}}[[Category:Primitive functions]][[Category:Scalar monadic functions]] | {{APL built-ins}}[[Category:Primitive functions]][[Category:Scalar monadic functions]] |