Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 18 additions & 12 deletions docs/dictionary/operator/asterisk.lcdoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,21 @@ Type: operator
Syntax: <number1> * <number2>

Summary:
Multiplies two numbers.
Multiplies two numbers or arrays containing numbers.

Introduced: 1.0

OS: mac, windows, linux, ios, android
OS: mac, windows, linux, ios, android, html5

Platforms: desktop, server, mobile

Example:
local thisNumber
get 3 * 5 -- evaluates to 15
put thisNumber * it into field "Result"

Example:
local commonFactor, tempVariable
put (3 + commonFactor) * 4 into tempVariable

Example:
Expand All @@ -28,25 +30,29 @@ put tArray * 10 into tProductArray

Parameters:
number1:

A number or an expression that evaluates to a number, or an array
containing numbers.

number2:
The operands number2 and number2 are numbers or expressions that
evaluate to numbers, or arrays containing numbers.
A number or an expression that evaluates to a number, or an array
containing numbers.

Description:
Use the <*> (times) <operator> to multiply two numbers.

> *Note:* When used in complex arithmetic statements,
<operator|operators> like <*> follows standard rules of <precedence>.

To multiply the contents of a container by a number, use the <multiply>
<command> instead.

If either <number1> or <number2> is an <array>, each of the <array>
<element(glossary)|elements> must be a number. If an <array> is
multiplied by a number, each <element(keyword)> is multiplied by the
<element|elements> must be a number. If an <array> is
multiplied by a number, each <element> is multiplied by the
number. If an <array> is multiplied by an <array>, both <array|arrays>
must have the same number of <element(glossary)|elements> and the same
dimension, and each <element(keyword)> in one <array> is multiplied by
the corresponding <element(keyword)> of the other <array>.
must have the same number of <element|elements> and the same
dimension, and each <element> in one <array> is multiplied by
the corresponding <element> of the other <array>.

If an element of one array is empty, the <*> <operator> treats its
contents as zero.
Expand All @@ -56,8 +62,8 @@ The option to multiply arrays was introduced in version 1.1. In previous
versions, only single numbers could be used with the * operator.

References: multiply (command), operator (glossary), array (glossary),
command (glossary), element (glossary), element (keyword), / (operator),
() (operator)
command (glossary), element (glossary), / (operator),
() (operator), precedence (glossary)

Tags: math