Function prod #

计算矩阵或列表值的乘积。对于多维数组或矩阵,将计算所有元素的乘积。

Syntax #

math.prod(a, b, c, ...)
math.prod(A)

Parameters #

Parameter Type Description
args … * 单个矩阵或多个标量值

Returns #

Type Description
* 所有值的乘积

Throws #

Type | Description —- | ———–

Examples #

math.multiply(2, 3)           // returns 6
math.prod(2, 3)               // returns 6
math.prod(2, 3, 4)            // returns 24
math.prod([2, 3, 4])          // returns 24
math.prod([[2, 5], [4, 3]])   // returns 120

另请参阅 #

mean, median, min, max, sum, std, variance

Fork me on GitHub