Tinderbox v9 Icon

* (i.e. multiplication)

Operator Type: 

Operator Scope of Action: 

Operator Purpose: 

Operator First Added: 

Operator Last Altered: 

 Operator  [other Operator type actions]

 Item  [operators of similar scope]

 Mathematical  [other Mathematical operators]


 As at baseline

The multiplication operator, * (asterisk character), returns the multiplication of the arguments before and after it.

$MyNumber = 3*4; 

Both arguments are normally Number-type data.

Multiplying Strings

Sometimes there is a need to expand or repeat a String. For this, the multiplication operator * may be used. Due to Tinderbox's internal type coercion effects, the number argument must be used as the first argument; placing it after the * will cause a silent fail with no resulting output. Thus, the expression:

$MyString = 3*"xyz "; 

evaluates to a string "xyz xyz xyz". But this:

$MyString = "xyz "*3; WRONG!

will return nothing.

Multiplying Lists and Sets

Lists and Sets of numbers may be multiplied by a number. Two lists of numbers may be multiplied if they have the same length, in which case their elements are multiplied.

[1;2;3;4] * [1;2;3;4];[1;4;9;12] 

or, using the range operator:

1...4 * 1...4 ➛ 1;4;9;12