float ScalarProduct( float* a1, float* a2, int n ) { float ans = 0.0; register int i; for( i = 0; i < n; ++i ) ans += a1[i] * a2[i]; return( ans ); }