home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_11_09
/
1109086a
< prev
next >
Wrap
Text File
|
1993-07-08
|
1KB
|
39 lines
sun_vaddosb(vect_in1,incr_in1,vect_in2,incr_in2,
vect_out,incr_out,vect_length)
float *vect_in1, *vect_in2, *vect_out;
int vect_length, incr_in1, incr_in2, incr_out;
{
register float tmp,
tmp_1,
tmp_2;
if((incr_in1 == 1) && (incr_in2 == 1) && (incr_out == 1))
{
while(vect_length--)
{
tmp_1 = *vect_in1++;
tmp_2 = *vect_in2++;
tmp = tmp_1 - tmp_2;
*vect_out++ = (tmp_1 + tmp_2) / tmp;
}
}
else
{
while(vect_length--)
{
tmp_1 = *vect_in1;
tmp_2 = *vect_in2;
tmp = tmp_1 - tmp_2;
*vect_out = (tmp_1 + tmp_2) / tmp;
vect_in1 += incr_in1;
vect_in2 += incr_in2;
vect_out += incr_out;
}
}
}