UNPKG

@stdlib/esm

Version:

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

3 lines 805 B
// 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"./../../assert/is-nonnegative-integer.js";import i from"./../base/assert/is-nan.js";var t=r.isPrimitive,n=e.isPrimitive,a=i;function s(r,e,i){var s,o,m,u,f;if(!t(r)||a(r))throw new TypeError("invalid argument. Start must be numeric. Value: `"+r+"`.");if(!t(e)||a(e))throw new TypeError("invalid argument. Stop must be numeric. Value: `"+e+"`.");if(arguments.length<3)i=100;else{if(!n(i))throw new TypeError("invalid argument. Length must be a nonnegative integer. Value: `"+i+"`.");if(0===i)return[]}for(u=(e-r)/(o=i-1),m=r,(s=new Array(i))[0]=m,f=1;f<o;f++)m+=u,s[f]=m;return s[o]=e,s}var o=s;export default o; //# sourceMappingURL=linspace.js.map