div | ||||||||||
Type | operator | |||||||||
Dictionary | LCS | |||||||||
Library | LiveCode Script | |||||||||
Syntax |
| |||||||||
Summary | Divides one number by another and returns the integer part of the result. | |||||||||
Introduced | 1.0 | |||||||||
Changes | The option to divide arrays was introduced in version 1.1. In previous versions, only single numbers could be used with the div operator. | |||||||||
OS | mac, windows, linux, ios, android | |||||||||
Platforms | desktop, server, mobile | |||||||||
Parameters |
| |||||||||
Example |
| |||||||||
Values |
| |||||||||
Related | Keyword: integer, element Glossary: operator, array, element, return, expression, math operation Operator: / | |||||||||
Description | Use the div operator to do integer division. If the number to be divided is an array, each of the array elements must be a number. If an array is divided by a number, each element is divided by the number. If an array is divided by an array, both arrays must have the same number of elements and the same dimension, and each element in one array is divided by the corresponding element of the other array. If an element of an array is empty, the div operator treats its contents as zero. The expression dividend div divisor is equivalent to trunc(dividend/divisor). If dividend can be divided evenly into divisor, the expression dividend div divisor is equal to dividend/divisor. If a math operation on finite inputs produces a non-finite output, an execution error is thrown. See math operations for more information. | |||||||||
Tags | math |