@@ -2,23 +2,25 @@ Name: /
22
33Type: operator
44
5- Syntax: <number > /divisor
5+ Syntax: <dividend > / < divisor>
66
77Summary:
8- Divides one number by another number.
8+ Divides one number by another number or one array by another array .
99
1010Introduced: 1.0
1111
12- OS: mac, windows, linux, ios, android
12+ OS: mac, windows, linux, ios, android, html5
1313
1414Platforms: desktop, server, mobile
1515
1616Example:
1717# Dividing a literal number by another
18+ local approxPi
1819put 22/7 into approxPi -- approximates pi
1920
2021Example:
2122# Dividing two variables
23+ local thisVariable
2224get thisVariable/(thisVariable + 1)
2325
2426Example:
@@ -30,38 +32,47 @@ put 10 into tDivisorArray[1]
3032put 5 into tDivisorArray[2]
3133put tNumberArray / tDivisorArray into tDividedArray
3234put tDividedArray[1] & comma & tDividedArray[2]
33- # The result is 1,4
35+ # Yields 1,4
3436
3537Parameters:
36- number:
37- The operands number and divisor are numbers, or expressions that
38- evaluate to numbers, or arrays containing numbers.
38+ dividend:
39+ A number or an expression that
40+ evaluates to a number, or an array containing numbers.
41+
42+ divisor:
43+ A number or an expression that
44+ evaluates to a number, or an array containing numbers.
3945
4046Description:
4147Use the </> (divide) <operator> to divide one number by another.
4248
49+ > *Note:* When used in complex arithmetic statements,
50+ <operator|operators> like </> follows standard rules of <precedence>.
51+
4352To divide the contents of a container by a number, use the <divide>
4453<command> instead.
4554
46- If <number > is an <array>, each of the <array>
55+ If <dividend> or <divisor > is an <array>, each of the <array>
4756<element(glossary)|elements> must be a number. If an <array> is divided
4857by a number, each <element(keyword)> is divided by the number. If an
4958<array> is divided by an <array>, both <array|arrays> must have the same
5059number of <element(glossary)|elements> and the same dimension, and each
5160<element(keyword)> in one <array> is divided by the corresponding
5261<element(keyword)> of the other <array>.
5362
54- If an element of an array is empty, the </> <operator> treats its
63+ If an element of an array is empty, the </> <operator> treats its
5564contents as zero.
5665
57- Attempting to divide by zero causes an execution error.
66+ > *Important:* Attempting to divide by zero causes an execution error.
67+
5868
5969Changes:
6070The option to divide arrays was introduced in version 1.1. In previous
6171versions, only single numbers could be used with the / operator.
6272
6373References: divide (command), operator (glossary), array (glossary),
64- command (glossary), element (glossary), element (keyword), div (operator),
74+ command (glossary), element (glossary), element (keyword),
75+ div (operator), precedence (glossary),
6576mod (operator), * (operator), wrap (operator)
6677
6778Tags: math
0 commit comments