DIVS function

Syntax

DIVS (array1, array2)
CALL -DIVS (return.array, array1, array2)
CALL !DIVS (return.array, array1, array2)

Description

Use the DIVS function to create a dynamic array containing the result of the element-by-element division of two dynamic arrays.

Each element of array1 is divided by the corresponding element of array2 with the result being returned in the corresponding element of a new dynamic array. If elements of array1 have no corresponding elements in array2, array2 is padded with ones and the array1 elements are returned. If an element of array2 has no corresponding element in array1, 0 is returned. If an element of array2 is 0, a run-time error message is printed and a 0 is returned. If either element of a corresponding pair is the null value, null is returned.

If you use the subroutine syntax, the resulting dynamic array is returned as return.array.

Example

A=10:@VM:15:@VM:9:@SM:4
B=2:@VM:5:@VM:9:@VM:2
PRINT DIVS(A,B)

This is the program output:

5V3V1S4V0