Index of Functions: A B C D E F G H I J K L M N O P Q R S T U V W X
Index Page sumad_c

Table of contents

Procedure Abstract Required_Reading Keywords Brief_I/O Detailed_Input | Detailed_Output Parameters Exceptions Files Particulars Examples | Restrictions Literature_References Author_and_Institution Version Index_Entries

#### Procedure

       sumad_c ( Sum of a double precision array )

       SpiceDouble sumad_c ( ConstSpiceDouble   * array,
                             SpiceInt             n     )

#### Abstract

       Return the sum of the elements of a double precision array.

#### Required_Reading

       None.

#### Keywords

       ARRAY
       MATH
       UTILITY

#### Brief_I/O

       VARIABLE  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_Input

       array       is the input double precision array.

       n           is the number of elements in the array.

#### Detailed_Output

       The function returns the sum of the elements of the input array.
       That is,

          sumad_c( array, n ) = array[0] + array[1] + ... + array[n-1]

       If `n' is zero or negative, sumad_c is zero.

#### Parameters

       None.

#### Exceptions

       Error free.

#### Files

       None.

#### Particulars

       The 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, sumad_c is zero.

#### Examples

       Let `array' contain the following elements.

             array[0] = 12.
             array[1] =  1.
             array[2] =  4.
             array[3] = 75.
             array[4] = 18.

       Then

             sumad_c ( array,   -3 )       =   0.
             sumad_c ( array,    0 )       =   0.
             sumad_c ( array,    1 )       =  12.
             sumad_c ( array,    2 )       =  13.
             sumad_c ( array,    5 )       = 110.
             sumad_c ( array+2,  3 )       =  97.

#### Restrictions

       1)  sumad_c does not check for overflow.

#### Literature_References

       None.

#### Author_and_Institution

       N.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_Entries

       sum of a d.p. array

#### Link to routine sumad_c source file sumad_c.c

    Fri Dec 31 18:41:13 2021