Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Index

Type aliases

Functions

Type aliases

accumulator

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

If provided a value, returns an updated mid-range; otherwise, returns the current mid-range.

Notes

  • The mid-range is the arithmetic mean of maximum and minimum values. Accordingly, the mid-range is the midpoint of the range and a measure of central tendency.
  • 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

returns

mid-range

Type declaration

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

      • Optional x: undefined | number

      Returns number | null

Functions

Export assignment incrmidrange

  • Returns an accumulator function which incrementally computes a mid-range.

    Returns accumulator

    accumulator function

    Example

    var accumulator = incrmidrange();
    
    var midrange = accumulator();
    // returns null
    
    midrange = accumulator( 3.14 );
    // returns 3.14
    
    midrange = accumulator( -5.0 );
    // returns ~-0.93
    
    midrange = accumulator( 10.1 );
    // returns 2.55
    
    midrange = accumulator();
    // returns 2.55