Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "stats/incr/sumprod/docs/types/index.d"

Index

Type aliases

Functions

Type aliases

accumulator

accumulator: (x?: undefined | number, y?: undefined | number) => number | null

If provided arguments, returns an updated sum of products; otherwise, returns the current sum of products.

Notes

  • If provided NaN or a value which, when used in computations, results in NaN, the accumulated value is NaN for all future invocations.
param

value

param

value

returns

sum of products

Type declaration

    • (x?: undefined | number, y?: undefined | number): number | null
    • Parameters

      • Optional x: undefined | number
      • Optional y: undefined | number

      Returns number | null

Functions

Export assignment incrsumprod

  • Returns an accumulator function which incrementally computes a sum of products.

    Returns accumulator

    accumulator function

    Example

    var accumulator = incrsumprod();
    
    var v = accumulator();
    // returns null
    
    v = accumulator( 2.0, 3.0 );
    // returns 6.0
    
    v = accumulator( -5.0, 2.0 );
    // returns -4.0
    
    v = accumulator();
    // returns -4.0