The infix math operators take two arguments, left hand side and right hand side. You cannot use a nested list as left hand side argument in a math infix operation. The left hand size is a single list that determines the number of items in each result list. The right hand side determines the structure of the result in terms of number of lists.
For example,
[1,2,3] * [3,4] = [3,6,9],[4,8,12]
means that each result list has three items, as determined by the left hand size, and there are two three-item list as determined by the right hand side.
Lists as math arguments affect the following math functions:
addition (a+b)
subtraction (a-b)
division (a/b)
multiplication (a*b)
power(a,b)
Modulo, mod(a,b)
For example, let us calculate (a*b) where a=[1,2,3] and b=[[3,4],[4,5]]. You can write the arguments as shown in the following table:
You can do the following basic computation of (a*b):
[[1*3,2*3, 3*3],[1*4, 2*4, 3*4]],[[1*4,2*4,3*4], [1*5,2*5, 3*5]]]
The result of the computation is as follows:
[[3,6,9],[4,8,12]],[[4,8,12],[5,10,15]]]
To compute power and modulo, power(a,b) or mod(a,b), see the following examples.
The following example describes how to use the modulo operator:
mod(2,[2,3])=[0,1])
The following example describes how to use the power operator:
power(2,[2,3])=[4,8])