Fact
Fact() 會傳回正整數 x 的階乘。
Syntax:
Fact(x)
Return data type: 整數
Limitations:
若 x 不是整數,就會遭截斷。非正數會傳回
Examples and results:
範例 | 結果 |
---|---|
Fact( 1 ) |
傳回 1 |
Fact( 5 ) |
傳回 120 (1 * 2 * 3 * 4 * 5 = 120) |
Fact( -5 ) |
傳回 |