aboutsummaryrefslogtreecommitdiff
path: root/sys/vops/ak/ahivx.x
blob: b487aa8df62ade1440b964765427236cab98bd9b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.

# AHIV -- Compute the high value (maximum) of a vector.

complex procedure ahivx (a, npix)

complex	a[ARB]
int	npix
complex	high, pixval
real	abs_high
int	i

begin
	high = a[1]
	abs_high = abs (high)

	do i = 1, npix {
	    pixval = a[i]
	    if (abs (pixval) > abs_high) {
		high = pixval
		abs_high = abs (high)
	    }
	}

	return (high)
end