HP 3000 Manuals

DOT [ HP Business BASIC/XL Reference Manual ] MPE/iX 5.0 Documentation


HP Business BASIC/XL Reference Manual

DOT 

The DOT function returns the dot product, or inner product, of two
vectors.  The elements of the two vectors must be of the same type.  If
they are short integer arrays, the result is an integer; otherwise, the
result is the same type.  Intermediate calculations for computing the DOT
product of two short decimal type vectors are performed after converting
each of the appropriate elements to decimal type values.  Therefore, in
compiled programs, short decimal overflow is reported as decimal
overflow.  The result is of the default numeric type.

Syntax 

DOT(num_vector1,num_vector2)

Parameters 

num_vector1      A numeric one dimensional array.

num_vector2      A numeric one dimensional array.

Examples 

OPTION BASE 1 is assumed.

     A(4) = 1 2 3 4
     B(4) = 2 2 2 2

     DOT (A,B) = 1*2+2*2+3*2+4*2= 21



MPE/iX 5.0 Documentation