Error getting tags :
error 404Error getting tags :
error 404 / | revDocs | RunRev
Welcome Guest (Log in)
Product Edition
Version
/
Basics
Expander triangle
Type
Operator
Syntax

number/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 number.
Examples

# Dividing a literal number by another
put 22/7 into approxPi -- approximates pi
# Dividing two variables
get thisVariable/(thisVariable + 1)
# Dividing an array by another
local tNumberArray, tDivisorArray, tDividedArray
put 10 into tNumberArray[1]
put 20 into tNumberArray[2]
put 10 into tDivisorArray[1]
put 5 into tDivisorArray[2]
put tNumberArray / tDivisorArray into tDividedArray
put tDividedArray[1] & comma & tDividedArray[2]
# The result is 1,4

Additional Comments
Expander triangle

Use the / (divide) operator to divide one number by another.

Parameters:

The operands number and divisor are numbers, or expressions that evaluate to numbers, or arrays containing numbers.

Comments:

To divide the contents of a container by a number, use the divide command instead.

If number 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 / operator treats its contents as zero.

Attempting to divide by zero causes an execution error.

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 / operator.

User Comments
Expander triangle