PRD

Contents


prd allows you to find the product of a series of numeric variables.

 

Syntax

   prd (exprg_list)

 

Parameters

Element

Description

Remarks

exprg_list

List of generalized_expressions separated by a comma (,)

All expressions must be numeric.

 

Examples

    # Product of several numeric expressions
    PRIX = prd(QUANTITE, PRIX_UNIT, REMISES(0..REMISE_MAX))
   # Factorial of 5(when you do not know the fac function);
    Integer ENTIERS(1..5)
    For I = 1 To 5:  ENTIERS(I) = I:  Next I
    FACTORIELLE = prd(ENTIERS(1..5))
    Infbox "factorial of 5 ="-num$(FACTORIELLE)

 

Description and Comments

prd calculates the product of any number of variables or numeric expressions.

You may mix description, decimal, integer, floating, and dual-precision variables.

The type of result depends on the type of parameters and how great the result is. It may be Integer if all elements are of the Integer type and if the product is less than the greatest integer; Double if there is at least one Double in the series of parameters; Decimal in other situations.

If one of the function's parameters is a variable that was sized with no index or index range precision, then all of the variable's elements are used. The precision of an index or of an index range determines the elements to be considered.

If you give an index range in such a way that there is no corresponding element, for example prd(VARIABLE(1..0)), the the value returned is one (1).

 

Associated Errors

Error

Description

ERMODE (10)

The indexes given are not numeric.

ERINDI (8)

Range Error for Indexes

ERDOM (50)

The parameters are not numeric.

ERDIM (55)

Too many dimensions given

ERHUGE (13)

Numeric capacity exceeded

 

Associated Keywords

MIN - MAX - SUM - AVG - VAR - UNI - FIND


CONTENTS


Copyright © Sage 1999 - 2007