@stdlib/esm
Version:
ES module distribution for Stdlib, a standard library for JavaScript and Node.js.
3 lines • 822 B
JavaScript
// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0
import r from"./../../assert/is-number.js";import e from"./../../math/base/assert/is-nan.js";var n=r.isPrimitive,t=e;function i(r,e){var i,a,u,m,o;if(m=0,o=0,arguments.length){if(!n(r))throw new TypeError("invalid argument. First argument must be a number primitive. Value: `"+r+"`.");if(!n(e))throw new TypeError("invalid argument. Second argument must be a number primitive. Value: `"+e+"`.");return a=r,u=e,l}return a=0,u=0,s;function s(r,e){return 0===arguments.length?0===o?null:1===o?t(m)?NaN:0:m/(o-1):(a+=(i=r-a)/(o+=1),m+=i*(e-(u+=(e-u)/o)),o<2?t(m)?NaN:0:m/(o-1))}function l(r,e){return 0===arguments.length?0===o?null:m/o:(m+=(r-a)*(e-u))/(o+=1)}}var a=i;export default a;
//# sourceMappingURL=covariance.js.map