@stdlib/esm
Version:
ES module distribution for Stdlib, a standard library for JavaScript and Node.js.
3 lines • 1.32 kB
JavaScript
// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0
import r from"./../../utils/define-nonenumerable-read-only-property.js";import n from"./../../math/base/assert/is-nan.js";import e from"./../../math/base/special/floor.js";var t=n,a=e,f=128;function o(r,n,e,i,u){var s,m,p,l,v,c,d,N,b,j,y,h,x,g;if(r<=0)return n;if(1===r||0===i)return t(e[u])||(n[0]+=e[u],n[1]+=1),n;if(s=u,r<8){for(y=0,h=0,g=0;g<r;g++)(x=e[s])==x&&(y+=x,h+=1),s+=i;return n[0]+=y,n[1]+=h,n}if(r<=f){for(m=0,p=0,l=0,v=0,c=0,d=0,N=0,b=0,h=0,j=r%8,g=0;g<r-j;g+=8)(x=e[s])==x&&(m+=x,h+=1),(x=e[s+=i])==x&&(p+=x,h+=1),(x=e[s+=i])==x&&(l+=x,h+=1),(x=e[s+=i])==x&&(v+=x,h+=1),(x=e[s+=i])==x&&(c+=x,h+=1),(x=e[s+=i])==x&&(d+=x,h+=1),(x=e[s+=i])==x&&(N+=x,h+=1),(x=e[s+=i])==x&&(b+=x,h+=1),s+=i;for(y=m+p+(l+v)+(c+d+(N+b));g<r;g++)(x=e[s])==x&&(y+=x,h+=1),s+=i;return n[0]+=y,n[1]+=h,n}return h=a(r/2),o(h-=h%8,n,e,i,s)+o(r-h,n,e,i,s+h*i)}var i=o,u=[0,0];function s(r,n,e,t){return u[0]=0,u[1]=0,i(r,u,n,e,t),u[0]/u[1]}var m=s;function p(r,n,e){var t,a,f,o,i;if(r<=0)return NaN;if(1===r||0===e)return n[0];if(t=e<0?(1-r)*e:0,r<8){for(f=0,o=0,i=0;i<r;i++)(a=n[t])==a&&(f+=a,o+=1),t+=e;return 0===o?NaN:f/o}return m(r,n,e,t)}var l=r,v=p,c=s;l(v,"ndarray",c);export default v;
//# sourceMappingURL=dnanmeanpw.js.map