aboutsummaryrefslogtreecommitdiff
path: root/sys/vops/assq.gx
blob: 0189e01ecbe2f072c15f8fdc3a314b0d153e0519 (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.

# ASSQ -- Vector sum of squares.

$if (datatype == csir)
real procedure assq$t (a, npix)
real	sum
$else $if (datatype == ld)
double procedure assq$t (a, npix)
double	sum
$else
PIXEL procedure assq$t (a, npix)
PIXEL	sum
$endif $endif

PIXEL	a[ARB]
int	npix
int	i

begin
	sum = 0$f
	do i = 1, npix
	    sum = sum + (a[i] ** 2)
	
	return (sum)
end