sumai_c |
Table of contents
Proceduresumai_c ( Sum of an integer array ) SpiceInt sumai_c ( ConstSpiceInt * array, SpiceInt n ) AbstractReturn the sum of the elements of an integer array. Required_ReadingNone. KeywordsARRAY MATH UTILITY Brief_I/OVARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- array I Input array. n I Number of elements in `array'. The function returns the sum of the elements of `array'. Detailed_Inputarray is the input integer array. n is the number of elements in the array. Detailed_OutputThe function returns the sum of the elements of the input array. That is, sumai_c( array, n ) = array[0] + array[1] + ... + array[n-1] If `n' is zero or negative, sumai_c is zero. ParametersNone. ExceptionsError free. FilesNone. ParticularsThe value of the function is initially set to zero. The elements of the array are then added. If the number of elements is zero or negative, sumai_c is zero. ExamplesLet `array' contain the following elements. array[0] = 12 array[1] = 1 array[2] = 4 array[3] = 75 array[4] = 18 Then sumai_c ( array, -3 ) = 0 sumai_c ( array, 0 ) = 0 sumai_c ( array, 1 ) = 12 sumai_c ( array, 2 ) = 13 sumai_c ( array, 5 ) = 110 sumai_c ( array+2, 3 ) = 97 Restrictions1) sumai_c does not check for overflow. Literature_ReferencesNone. Author_and_InstitutionN.J. Bachman (JPL) J. Diaz del Rio (ODC Space) I.M. Underwood (JPL) Version-CSPICE Version 1.0.1, 09-APR-2021 (JDR) Edited the header to comply with NAIF standard. -CSPICE Version 1.0.0, 24-MAR-1999 (IMU) (NJB) Index_Entriessum of an integer array |
Fri Dec 31 18:41:13 2021