aboutsummaryrefslogtreecommitdiff
path: root/sys/vops/amax.gx
blob: ce61b5584653f16cb36705b1c677ab3a509eb194 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.

# AMAX -- Compute the maximum of two vectors (generic).

procedure amax$t (a, b, c, npix)

PIXEL	a[ARB], b[ARB], c[ARB]
int	npix, i

begin
	do i = 1, npix
	    $if (datatype == x)
		if (abs(a[i]) >= abs(b[i]))
		    c[i] = a[i]
		else
		    c[i] = b[i]
	    $else
		c[i] = max (a[i], b[i])
	    $endif
end