@@ -324,14 +324,14 @@ These functions are useful inside conditions, they can be used to evaluate any t
324
324
| Math function | Task |
325
325
| ------------- | ---- |
326
326
| [ add] ( control-flow-expression-language-functions.md#add ) | Return the result from adding two numbers. |
327
- | [ div] ( control-flow-expression-language-functions.md#div ) | Return the result from dividing two numbers . |
327
+ | [ div] ( control-flow-expression-language-functions.md#div ) | Return the result from dividing one number by another number . |
328
328
| [ max] ( control-flow-expression-language-functions.md#max ) | Return the highest value from a set of numbers or an array. |
329
329
| [ min] ( control-flow-expression-language-functions.md#min ) | Return the lowest value from a set of numbers or an array. |
330
- | [ mod] ( control-flow-expression-language-functions.md#mod ) | Return the remainder from dividing two numbers . |
330
+ | [ mod] ( control-flow-expression-language-functions.md#mod ) | Return the remainder from dividing one number by another number . |
331
331
| [ mul] ( control-flow-expression-language-functions.md#mul ) | Return the product from multiplying two numbers. |
332
332
| [ rand] ( control-flow-expression-language-functions.md#rand ) | Return a random integer from a specified range. |
333
333
| [ range] ( control-flow-expression-language-functions.md#range ) | Return an integer array that starts from a specified integer. |
334
- | [ sub] ( control-flow-expression-language-functions.md#sub ) | Return the result from subtracting the second number from the first number. |
334
+ | [ sub] ( control-flow-expression-language-functions.md#sub ) | Return the result from subtracting one number from another number. |
335
335
336
336
## Function reference
337
337
@@ -1398,34 +1398,46 @@ And returns this result: `"https://contoso.com"`
1398
1398
1399
1399
### div
1400
1400
1401
- Return the integer result from dividing two numbers.
1402
- To get the remainder result, see [ mod()] ( #mod ) .
1401
+ Return the result of dividing one number by another number.
1403
1402
1404
1403
```
1405
1404
div(<dividend>, <divisor>)
1406
1405
```
1407
1406
1407
+ The precise return type of the function depends on the types of its parameters &mdash ; see examples for detail.
1408
+
1408
1409
| Parameter | Required | Type | Description |
1409
1410
| --------- | -------- | ---- | ----------- |
1410
1411
| <* dividend* > | Yes | Integer or Float | The number to divide by the * divisor* |
1411
- | <* divisor* > | Yes | Integer or Float | The number that divides the * dividend* , but cannot be 0 |
1412
+ | <* divisor* > | Yes | Integer or Float | The number that divides the * dividend* . A * divisor * value of zero causes an error at runtime. |
1412
1413
|||||
1413
1414
1414
1415
| Return value | Type | Description |
1415
1416
| ------------ | ---- | ----------- |
1416
- | <* quotient-result* > | Integer | The integer result from dividing the first number by the second number |
1417
+ | <* quotient-result* > | Integer or Float | The result of dividing the first number by the second number |
1417
1418
||||
1418
1419
1419
- * Example*
1420
+ * Example 1 *
1420
1421
1421
- Both examples divide the first number by the second number :
1422
+ These examples divide the number 9 by 2 :
1422
1423
1423
1424
```
1424
- div(10, 5)
1425
- div(11, 5)
1425
+ div(9, 2.0)
1426
+ div(9.0, 2)
1427
+ div(9.0, 2.0)
1426
1428
```
1427
1429
1428
- And return this result: ` 2 `
1430
+ And all return this result: ` 4.5 `
1431
+
1432
+ * Example 2*
1433
+
1434
+ This example also divides the number 9 by 2, but because both parameters are integers the remainder is discarded (integer division):
1435
+
1436
+ ```
1437
+ div(9, 2)
1438
+ ```
1439
+
1440
+ The expression returns the result ` 4 ` . To obtain the value of the remainder, use the [ mod()] ( #mod ) function.
1429
1441
1430
1442
<a name =" encodeUriComponent " ></a >
1431
1443
@@ -2366,8 +2378,7 @@ And return this result: `1`
2366
2378
2367
2379
### mod
2368
2380
2369
- Return the remainder from dividing two numbers.
2370
- To get the integer result, see [ div()] ( #div ) .
2381
+ Return the remainder from dividing one number by another number. For integer division, see [ div()] ( #div ) .
2371
2382
2372
2383
```
2373
2384
mod(<dividend>, <divisor>)
@@ -2376,7 +2387,7 @@ mod(<dividend>, <divisor>)
2376
2387
| Parameter | Required | Type | Description |
2377
2388
| --------- | -------- | ---- | ----------- |
2378
2389
| <* dividend* > | Yes | Integer or Float | The number to divide by the * divisor* |
2379
- | <* divisor* > | Yes | Integer or Float | The number that divides the * dividend* , but cannot be 0 . |
2390
+ | <* divisor* > | Yes | Integer or Float | The number that divides the * dividend* . A * divisor * value of zero causes an error at runtime . |
2380
2391
|||||
2381
2392
2382
2393
| Return value | Type | Description |
@@ -2386,13 +2397,13 @@ mod(<dividend>, <divisor>)
2386
2397
2387
2398
* Example*
2388
2399
2389
- This example divides the first number by the second number:
2400
+ This example calculates the remainder when the first number is divided by the second number:
2390
2401
2391
2402
```
2392
2403
mod(3, 2)
2393
2404
```
2394
2405
2395
- And return this result: ` 1 `
2406
+ And returns this result: ` 1 `
2396
2407
2397
2408
<a name =" mul " ></a >
2398
2409
@@ -2407,7 +2418,7 @@ mul(<multiplicand1>, <multiplicand2>)
2407
2418
| Parameter | Required | Type | Description |
2408
2419
| --------- | -------- | ---- | ----------- |
2409
2420
| <* multiplicand1* > | Yes | Integer or Float | The number to multiply by * multiplicand2* |
2410
- | <* multiplicand2* > | Yes | Integer or Float | The number that multiples * multiplicand1* |
2421
+ | <* multiplicand2* > | Yes | Integer or Float | The number that multiplies * multiplicand1* |
2411
2422
|||||
2412
2423
2413
2424
| Return value | Type | Description |
@@ -2417,7 +2428,7 @@ mul(<multiplicand1>, <multiplicand2>)
2417
2428
2418
2429
* Example*
2419
2430
2420
- These examples multiple the first number by the second number:
2431
+ These examples multiply the first number by the second number:
2421
2432
2422
2433
```
2423
2434
mul(1, 2)
@@ -2878,7 +2889,7 @@ And returns this result: `"{ \\"name\\": \\"Sophie Owen\\" }"`
2878
2889
2879
2890
### sub
2880
2891
2881
- Return the result from subtracting the second number from the first number.
2892
+ Return the result from subtracting one number from another number.
2882
2893
2883
2894
```
2884
2895
sub(<minuend>, <subtrahend>)
0 commit comments