IMath.SumX2PY2

Syntax

SumX2PY2(X: Array; Y: Array): Double;

Parameters

X. Array of real numbers.

Y. Array of real numbers.

Description

The SumX2PY2 method returns the sum of square sums of the corresponding values in two arrays.

Comments

The X and Y arrays must be the same size.

The function works correctly with both one-dimension and two-dimension arrays.

Example

To execute the example, add a link to the MathFin system assembly.

Sub UserProc;
Var
    r: Double;
    X: Array[7Of Double;
    Y: Array[7Of Double;
Begin
    X[0] := 2; Y[0] := 6;
    X[1] := 3; Y[0] := 5;
    X[2] := 9; Y[0] := 11;
    X[3] := 1; Y[0] := 7;
    X[4] := 8; Y[0] := 6;
    X[5] := 7; Y[0] := 4;
    X[6] := 5; Y[0] := 4;
    r := Math.SumX2PY2(X, Y);
    Debug.WriteLine(r);
End Sub UserProc;

After executing the example the console window displays the sum of square sums equal to 249.

See also:

IMath