Skip to content

Commit 2262603

Browse files
authored
Merge pull request livecode#4930 from asayd/patch-18
[[ Documentation ]] Changes to slash.lcdoc
2 parents e3f56b9 + a07e000 commit 2262603

1 file changed

Lines changed: 22 additions & 11 deletions

File tree

docs/dictionary/operator/slash.lcdoc

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,25 @@ Name: /
22

33
Type: operator
44

5-
Syntax: <number> /divisor
5+
Syntax: <dividend> / <divisor>
66

77
Summary:
8-
Divides one number by another number.
8+
Divides one number by another number or one array by another array.
99

1010
Introduced: 1.0
1111

12-
OS: mac, windows, linux, ios, android
12+
OS: mac, windows, linux, ios, android, html5
1313

1414
Platforms: desktop, server, mobile
1515

1616
Example:
1717
# Dividing a literal number by another
18+
local approxPi
1819
put 22/7 into approxPi -- approximates pi
1920

2021
Example:
2122
# Dividing two variables
23+
local thisVariable
2224
get thisVariable/(thisVariable + 1)
2325

2426
Example:
@@ -30,38 +32,47 @@ put 10 into tDivisorArray[1]
3032
put 5 into tDivisorArray[2]
3133
put tNumberArray / tDivisorArray into tDividedArray
3234
put tDividedArray[1] & comma & tDividedArray[2]
33-
# The result is 1,4
35+
# Yields 1,4
3436

3537
Parameters:
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

4046
Description:
4147
Use 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+
4352
To 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
4857
by 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
5059
number 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
5564
contents 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

5969
Changes:
6070
The option to divide arrays was introduced in version 1.1. In previous
6171
versions, only single numbers could be used with the / operator.
6272

6373
References: 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),
6576
mod (operator), * (operator), wrap (operator)
6677

6778
Tags: math

0 commit comments

Comments
 (0)