>  Docs Center  >  Libraries  >  Markwardt  >  CMPRODUCT
Libraries

CMPRODUCT

CMPRODUCT

Name


  CMPRODUCT

Author


  Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
  craigm@lheamail.gsfc.nasa.gov

Purpose


  CMPRODUCT() is the multiplicative equivalent of TOTAL().

Calling Sequence


  Result = CMPRODUCT(ARRAY)

Description



  Calculates the product of all the elements of an array. Vector
  multiplication in groups of powers of two make this operation
  faster than a simple FOR loop. The number of actual
  multiplications is still N_ELEMENTS(ARRAY). Double precision
  should be used for the highest accuracy when multiplying many
  numbers.

Inputs



  ARRAY - Array of elements to multiply together. For instance,
          ARRAY could contain the dimensions of another array--then
          CMPRODUCT(ARRAY) would be the total number of elements of
          that other array.

Returns


  The result of the function is the total product of all the elements
  of ARRAY.

Example


See Also



  TOTAL, PRODUCT (from Astronomy User's Library)

Modification History


  Written, CM, 28 Mar 2000
    (based on outline of PRODUCT by William Thompson)



© 2024 NV5 Geospatial Solutions, Inc. |  Legal
My Account    |    Contact Us