System.Math.SumsAndSquares

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure SumsAndSquares(const Data: array of Single; var Sum, SumOfSquares: Extended);
procedure SumsAndSquares(const Data: array of Double; var Sum, SumOfSquares: Extended);
procedure SumsAndSquares(const Data: array of Extended; var Sum, SumOfSquares: Extended);

C++

extern DELPHI_PACKAGE void __fastcall SumsAndSquares(const float *Data, const int Data_High, System::Extended &Sum, System::Extended &SumOfSquares)/* overload */;

Properties

Type Visibility Source Unit Parent
procedure
function
public
System.Math.pas
System.Math.hpp
System.Math System.Math

Description

Returns the sum of the values and the sum of the squared values in an array.

SumsAndSquares returns the sum of the Data values in Sum and the sum of the squares in SumOfSquares. The data to sum is specified in the Data array parameter. In C++, Data_Size indicates the index of the last value (one less than the number of values in Data).

This function is faster than calculating the sums separately.

See Also