UNPKG

@stdlib/esm

Version:

ES module distribution for Stdlib, a standard library for JavaScript and Node.js.

3 lines 2.16 kB
// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 import e from"./../../utils/define-nonenumerable-read-only-property.js";import t from"./../../utils/define-nonenumerable-read-only-accessor.js";import n from"./../../utils/define-nonenumerable-read-write-accessor.js";import r from"./../../assert/is-plain-object.js";import o from"./../../utils/constant-function.js";import i from"./../../utils/noop.js";import a from"./gamma.js";import s from"./../../math/base/assert/is-nan.js";import u from"./../../array/to-json.js";import m from"./../../assert/is-positive-number.js";var l=m.isPrimitive;function f(e,t){return l(e)?l(t)?null:new TypeError("invalid argument. `beta` must be a positive number. Value: `"+t+"`."):new TypeError("invalid argument. `alpha` must be a positive number. Value: `"+e+"`.")}function p(e,t,n){return e(t,1)/e(n,1)}var c=e,g=t,b=n,d=r,h=o,v=i,j=a.factory,y=s,L=u,N=f,w=p;function E(){var e,t,n,r,o,i,a;if(0===arguments.length)e=j();else if(1===arguments.length){if(!d(r=arguments[0]))throw new TypeError("invalid argument. Options argument must be an object. Value: `"+r+"`.");e=j(r)}else{if(a=N(t=arguments[0],n=arguments[1]))throw a;if(arguments.length>2){if(!d(r=arguments[2]))throw new TypeError("invalid argument. Options argument must be an object. Value: `"+r+"`.");e=j(r)}else e=j()}return i=void 0===t?P:O,o=e.PRNG,c(i,"NAME","betaprime"),r&&r.prng?(c(i,"seed",null),c(i,"seedLength",null),b(i,"state",h(null),v),c(i,"stateLength",null),c(i,"byteLength",null),c(i,"toJSON",h(null))):(g(i,"seed",s),g(i,"seedLength",u),b(i,"state",f,p),g(i,"stateLength",m),g(i,"byteLength",l),c(i,"toJSON",E)),c(i,"PRNG",o),i;function s(){return o.seed}function u(){return o.seedLength}function m(){return o.stateLength}function l(){return o.byteLength}function f(){return o.state}function p(e){o.state=e}function E(){var e={type:"PRNG"};return e.name=i.NAME,e.state=L(o.state),e.params=void 0===t?[]:[t,n],e}function O(){return w(e,t,n)}function P(t,n){return y(t)||y(n)||t<=0||n<=0?NaN:w(e,t,n)}}var O=E,P=O(),T=e,V=P,G=E;T(V,"factory",G);export default V; //# sourceMappingURL=betaprime.js.map