Error getting tags :
error 404Error getting tags :
error 404 div | revDocs | RunRev
Product Edition
Version
div
Basics
Type
Operator
Syntax
number div divisor
Introduced
1.0
Changed
1.1
Environment
Desktop, Web and Server
Platform Support
MacOS,Mac OS X,Windows,Linux
Security
None required
Summary
Divides one number by another and returns the integer part of the result.
Examples

4 div 2 -- evaluates to 2
11 div 4 -- evaluates to 2 (since 11/4 = 2.75)
arrayOfNumbers div 10

Use the div operator to do integer division.

Parameters:

The number is a number, or an expression that evaluates to a number, or an array containing only numbers.

The divisor is any non-zero number. If the number is an array, the divisor is either a non-zero number or an array containing only non-zero numbers.

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`.

Attempting to divide by zero causes an execution error.

` Note: While using non-integer number and divisor usually produces sensible results, mathematically, integer division is generally defined as a function over the integers, and the results using non-integers may not consistently be what you expect.`

`Changes to Revolution:`

`The option to divide arrays was introduced in version 1.1. In previous versions, only single numbers could be used with the div operator.`

``` ```
``` ```
``` Lessons User Comments Your Comment Click here to log in and post a comment ```
``` ```
``` ```
``` Store LiveCode LiveCode Features Mobile Embedded LiveCode Desktop Server Developer Program Solutions SMEs Education Microsite Enterprise Game Academy Microsite Showcase Showcase Case Studies Get Started Developers Lessons & Tutorials Documentation Community Resources Developer Conference Newsletters Company About Us Company News Blog Management Team Consultants Careers Press Room Contact us Policies EULA Privacy Policy Environmental Policy Blog Copyright RunRev Ltd 2009 All rights reserved. ```
``` ```
``` ```
``` ```
``` ```
``` ```