Skip to content

Latest commit

 

History

History
42 lines (30 loc) · 971 Bytes

product.markdown

File metadata and controls

42 lines (30 loc) · 971 Bytes
layout title categories published alias tags
default
product
Reference
Functions
product
true
reference-functions-product.html
reference
data functions
functions
product

Prototype: product(list)

Return type: real

Description: Returns the product of the reals in list.

This function might be used for simple ring computation. Of course, you could easily combine product with readstringarray or readreallist etc., to collect summary information from a source external to CFEngine.

Arguments:

  • list : A list of arbitrary real values, in the range [a-zA-Z0-9_$(){}\[\].:]+

Example:

    bundle agent test
    {
    vars:

      "series" rlist => { "1.1", "2.2", "3.3", "5.5", "7.7" };

      "prod" real => product("series");
      "sum"  real => sum("series");

    reports:
        "Product result: $(prod) > $(sum)";
    }

History: Was introduced in version 3.1.0b1,Nova 2.0.0b1 (2010)