PRO array_arith
; scalar addition
a = 2.0
b = 3.0
print, 'a = ', a
print, 'b = ', b
print
print, 'a+b = ', a+b
print
c = [1.,3.,5.,7.]
d = [2.,2.,2.,2.]
print, 'c = ', c
print, 'd = ', d
print
; array addition/multiplication
print, 'c+d = ', c+d
print
print, 'c*d = ', c*d
print
; if any one of the variabiles in an expression is an array, the result will be an array
print, 'c*a = ', c*a
print
e = [10,10]
f = [1,2,3,4,5]
print, 'e = ', e
print, 'f = ', f
print
;if an expression contains arrays of different sizes, the result array will have as many elements
;as the smallest array in the expression
print,'e*f = ', e*f
g = FLTARR(10)+10.
h = INDGEN(3,2)
print, 'g = ', g
print, 'h = '
print, h
print
print,'g*h = '
print, g*h
print
;if an expression contains arrays with different numbers of elements and dimensions, the result array
; will have as many elements and as many dimensions as the smallest array in the expression
j = FLTARR(4)+10
k = INDGEN(2,2)
print, 'j = ', j
print, 'k = '
print, k
print
;if an expression contains arras with the same number of elements but different dimensions,
;the result array will have as many dimensions as the leftmost array in the expression
print, 'j*k = '
print,j*k
print
print,'k*j = '
print, k*j
print
END