@stdlib/stats-base-dists-frechet-logcdf 0.0.7 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/NOTICE CHANGED
@@ -1 +1 @@
1
- Copyright (c) 2016-2022 The Stdlib Authors.
1
+ Copyright (c) 2016-2024 The Stdlib Authors.
package/README.md CHANGED
@@ -18,6 +18,17 @@ limitations under the License.
18
18
 
19
19
  -->
20
20
 
21
+
22
+ <details>
23
+ <summary>
24
+ About stdlib...
25
+ </summary>
26
+ <p>We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.</p>
27
+ <p>The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.</p>
28
+ <p>When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.</p>
29
+ <p>To join us in bringing numerical computing to the web, get started by checking us out on <a href="https://github.com/stdlib-js/stdlib">GitHub</a>, and please consider <a href="https://opencollective.com/stdlib">financially supporting stdlib</a>. We greatly appreciate your continued support!</p>
30
+ </details>
31
+
21
32
  # Logarithm of Cumulative Distribution Function
22
33
 
23
34
  [![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] <!-- [![dependencies][dependencies-image]][dependencies-url] -->
@@ -212,7 +223,7 @@ See [LICENSE][stdlib-license].
212
223
 
213
224
  ## Copyright
214
225
 
215
- Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].
226
+ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
216
227
 
217
228
  </section>
218
229
 
@@ -225,8 +236,8 @@ Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].
225
236
  [npm-image]: http://img.shields.io/npm/v/@stdlib/stats-base-dists-frechet-logcdf.svg
226
237
  [npm-url]: https://npmjs.org/package/@stdlib/stats-base-dists-frechet-logcdf
227
238
 
228
- [test-image]: https://github.com/stdlib-js/stats-base-dists-frechet-logcdf/actions/workflows/test.yml/badge.svg?branch=v0.0.7
229
- [test-url]: https://github.com/stdlib-js/stats-base-dists-frechet-logcdf/actions/workflows/test.yml?query=branch:v0.0.7
239
+ [test-image]: https://github.com/stdlib-js/stats-base-dists-frechet-logcdf/actions/workflows/test.yml/badge.svg?branch=v0.2.0
240
+ [test-url]: https://github.com/stdlib-js/stats-base-dists-frechet-logcdf/actions/workflows/test.yml?query=branch:v0.2.0
230
241
 
231
242
  [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/stats-base-dists-frechet-logcdf/main.svg
232
243
  [coverage-url]: https://codecov.io/github/stdlib-js/stats-base-dists-frechet-logcdf?branch=main
@@ -239,7 +250,7 @@ Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].
239
250
  -->
240
251
 
241
252
  [chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
242
- [chat-url]: https://gitter.im/stdlib-js/stdlib/
253
+ [chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im
243
254
 
244
255
  [stdlib]: https://github.com/stdlib-js/stdlib
245
256
 
@@ -249,8 +260,11 @@ Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].
249
260
  [es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
250
261
 
251
262
  [deno-url]: https://github.com/stdlib-js/stats-base-dists-frechet-logcdf/tree/deno
263
+ [deno-readme]: https://github.com/stdlib-js/stats-base-dists-frechet-logcdf/blob/deno/README.md
252
264
  [umd-url]: https://github.com/stdlib-js/stats-base-dists-frechet-logcdf/tree/umd
265
+ [umd-readme]: https://github.com/stdlib-js/stats-base-dists-frechet-logcdf/blob/umd/README.md
253
266
  [esm-url]: https://github.com/stdlib-js/stats-base-dists-frechet-logcdf/tree/esm
267
+ [esm-readme]: https://github.com/stdlib-js/stats-base-dists-frechet-logcdf/blob/esm/README.md
254
268
  [branches-url]: https://github.com/stdlib-js/stats-base-dists-frechet-logcdf/blob/main/branches.md
255
269
 
256
270
  [stdlib-license]: https://raw.githubusercontent.com/stdlib-js/stats-base-dists-frechet-logcdf/main/LICENSE
package/SECURITY.md ADDED
@@ -0,0 +1,5 @@
1
+ # Security
2
+
3
+ > Policy for reporting security vulnerabilities.
4
+
5
+ See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security).
@@ -0,0 +1,3 @@
1
+ /// <reference path="../docs/types/index.d.ts" />
2
+ import logCDF from '../docs/types/index';
3
+ export = logCDF;
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ "use strict";var c=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var v=c(function(b,f){
2
+ var n=require('@stdlib/math-base-assert-is-nan/dist'),y=require('@stdlib/math-base-special-pow/dist'),d=require('@stdlib/constants-float64-ninf/dist');function F(e,r,t,u){var i;return n(e)||n(r)||n(t)||n(u)||r<=0||t<=0?NaN:e<=u?d:(i=(e-u)/t,-y(i,-r))}f.exports=F
3
+ });var N=c(function(j,q){
4
+ var g=require('@stdlib/utils-constant-function/dist'),a=require('@stdlib/math-base-assert-is-nan/dist'),w=require('@stdlib/math-base-special-pow/dist'),z=require('@stdlib/constants-float64-ninf/dist');function I(e,r,t){if(a(e)||a(r)||a(t)||e<=0||r<=0)return g(NaN);return u;function u(i){var o;return a(i)?NaN:i<=t?z:(o=(i-t)/r,-w(o,-e))}}q.exports=I
5
+ });var p=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),s=v(),O=N();p(s,"factory",O);module.exports=s;
6
+ /** @license Apache-2.0 */
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../lib/main.js", "../lib/factory.js", "../lib/index.js"],
4
+ "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math-base-assert-is-nan' );\nvar pow = require( '@stdlib/math-base-special-pow' );\nvar NINF = require( '@stdlib/constants-float64-ninf' );\n\n\n// MAIN //\n\n/**\n* Evaluates the natural logarithm of the cumulative distribution function (CDF) for a Fr\u00E9chet distribution with shape `alpha`, scale `s`, and location `m` at a value `x`.\n*\n* @param {number} x - input value\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {number} m - location parameter\n* @returns {number} evaluated logCDF\n*\n* @example\n* var y = logcdf( 10.0, 2.0, 3.0, 2.0 );\n* // returns ~-0.141\n*\n* @example\n* var y = logcdf( -2.5, 1.0, 3.0, -3.0 );\n* // returns -6.0\n*\n* @example\n* var y = logcdf( 0.0, 2.0, 1.0, -1.0 );\n* // returns -1.0\n*\n* @example\n* var y = logcdf( NaN, 2.0, 1.0, -1.0 );\n* // returns NaN\n*\n* @example\n* var y = logcdf( 0.0, NaN, 1.0, -1.0 );\n* // returns NaN\n*\n* @example\n* var y = logcdf( 0.0, 2.0, NaN, -1.0 );\n* // returns NaN\n*\n* @example\n* var y = logcdf( 0.0, 2.0, 1.0, NaN );\n* // returns NaN\n*\n* @example\n* var y = logcdf( 0.0, -1.0, 1.0, 0.0 );\n* // returns NaN\n*\n* @example\n* var y = logcdf( 0.0, 1.0, -1.0, 0.0 );\n* // returns NaN\n*/\nfunction logcdf( x, alpha, s, m ) {\n\tvar z;\n\tif (\n\t\tisnan( x ) ||\n\t\tisnan( alpha ) ||\n\t\tisnan( s ) ||\n\t\tisnan( m ) ||\n\t\talpha <= 0.0 ||\n\t\ts <= 0.0\n\t) {\n\t\treturn NaN;\n\t}\n\tif ( x <= m ) {\n\t\treturn NINF;\n\t}\n\tz = ( x - m ) / s;\n\treturn -pow( z, -alpha );\n}\n\n\n// EXPORTS //\n\nmodule.exports = logcdf;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar constantFunction = require( '@stdlib/utils-constant-function' );\nvar isnan = require( '@stdlib/math-base-assert-is-nan' );\nvar pow = require( '@stdlib/math-base-special-pow' );\nvar NINF = require( '@stdlib/constants-float64-ninf' );\n\n\n// MAIN //\n\n/**\n* Returns a function for evaluating the natural logarithm of the cumulative distribution function (CDF) for a Fr\u00E9chet distribution with shape `alpha`, scale `s`, and location `m`.\n*\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {number} m - location parameter\n* @returns {Function} logCDF\n*\n* @example\n* var logcdf = factory( 3.0, 3.0, 5.0 );\n*\n* var y = logcdf( 10.0 );\n* // returns ~-0.216\n*\n* y = logcdf( 7.0 );\n* // returns ~-3.375\n*/\nfunction factory( alpha, s, m ) {\n\tif (\n\t\tisnan( alpha ) ||\n\t\tisnan( s ) ||\n\t\tisnan( m ) ||\n\t\talpha <= 0.0 ||\n\t\ts <= 0.0\n\t) {\n\t\treturn constantFunction( NaN );\n\t}\n\treturn logcdf;\n\n\t/**\n\t* Evaluates the natural logarithm of the cumulative distribution function (CDF) for a Fr\u00E9chet distribution.\n\t*\n\t* @private\n\t* @param {number} x - input value\n\t* @returns {number} evaluated logCDF\n\t*\n\t* @example\n\t* var y = logcdf( -2.0 );\n\t* // returns <number>\n\t*/\n\tfunction logcdf( x ) {\n\t\tvar z;\n\t\tif ( isnan( x ) ) {\n\t\t\treturn NaN;\n\t\t}\n\t\tif ( x <= m ) {\n\t\t\treturn NINF;\n\t\t}\n\t\tz = ( x - m ) / s;\n\t\treturn -pow( z, -alpha );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fr\u00E9chet distribution logarithm of the cumulative distribution function (CDF).\n*\n* @module @stdlib/stats-base-dists-frechet-logcdf\n*\n* @example\n* var logcdf = require( '@stdlib/stats-base-dists-frechet-logcdf' );\n*\n* var y = logcdf( 10.0, 2.0, 3.0, 5.0 );\n* // returns ~-0.36\n*\n* y = logcdf( 3.8, 2.0, 3.0, 2.0 );\n* // returns ~-2.778\n*\n* @example\n* var factory = require( '@stdlib/stats-base-dists-frechet-logcdf' ).factory;\n* var logcdf = factory( 3.0, 3.0, 5.0 );\n* var y = logcdf( 10.0 );\n* // returns ~-0.216\n*\n* y = logcdf( 7.0 );\n* // returns ~-3.381\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
5
+ "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAQ,QAAS,iCAAkC,EACnDC,EAAM,QAAS,+BAAgC,EAC/CC,EAAO,QAAS,gCAAiC,EAkDrD,SAASC,EAAQC,EAAGC,EAAOC,EAAGC,EAAI,CACjC,IAAIC,EACJ,OACCR,EAAOI,CAAE,GACTJ,EAAOK,CAAM,GACbL,EAAOM,CAAE,GACTN,EAAOO,CAAE,GACTF,GAAS,GACTC,GAAK,EAEE,IAEHF,GAAKG,EACFL,GAERM,GAAMJ,EAAIG,GAAMD,EACT,CAACL,EAAKO,EAAG,CAACH,CAAM,EACxB,CAKAN,EAAO,QAAUI,IChGjB,IAAAM,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAmB,QAAS,iCAAkC,EAC9DC,EAAQ,QAAS,iCAAkC,EACnDC,EAAM,QAAS,+BAAgC,EAC/CC,EAAO,QAAS,gCAAiC,EAsBrD,SAASC,EAASC,EAAOC,EAAGC,EAAI,CAC/B,GACCN,EAAOI,CAAM,GACbJ,EAAOK,CAAE,GACTL,EAAOM,CAAE,GACTF,GAAS,GACTC,GAAK,EAEL,OAAON,EAAkB,GAAI,EAE9B,OAAOQ,EAaP,SAASA,EAAQC,EAAI,CACpB,IAAIC,EACJ,OAAKT,EAAOQ,CAAE,EACN,IAEHA,GAAKF,EACFJ,GAERO,GAAMD,EAAIF,GAAMD,EACT,CAACJ,EAAKQ,EAAG,CAACL,CAAM,EACxB,CACD,CAKAN,EAAO,QAAUK,ICxCjB,IAAIO,EAAc,QAAS,uDAAwD,EAC/EC,EAAO,IACPC,EAAU,IAKdF,EAAaC,EAAM,UAAWC,CAAQ,EAKtC,OAAO,QAAUD",
6
+ "names": ["require_main", "__commonJSMin", "exports", "module", "isnan", "pow", "NINF", "logcdf", "x", "alpha", "s", "m", "z", "require_factory", "__commonJSMin", "exports", "module", "constantFunction", "isnan", "pow", "NINF", "factory", "alpha", "s", "m", "logcdf", "x", "z", "setReadOnly", "main", "factory"]
7
+ }
@@ -16,7 +16,7 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- // TypeScript Version: 2.0
19
+ // TypeScript Version: 4.1
20
20
 
21
21
  /**
22
22
  * Evaluates the natural logarithm of the cumulative distribution function (CDF) for a Fréchet distribution.
package/lib/index.js CHANGED
@@ -45,15 +45,15 @@
45
45
  // MODULES //
46
46
 
47
47
  var setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );
48
- var logcdf = require( './logcdf.js' );
48
+ var main = require( './main.js' );
49
49
  var factory = require( './factory.js' );
50
50
 
51
51
 
52
52
  // MAIN //
53
53
 
54
- setReadOnly( logcdf, 'factory', factory );
54
+ setReadOnly( main, 'factory', factory );
55
55
 
56
56
 
57
57
  // EXPORTS //
58
58
 
59
- module.exports = logcdf;
59
+ module.exports = main;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stdlib/stats-base-dists-frechet-logcdf",
3
- "version": "0.0.7",
3
+ "version": "0.2.0",
4
4
  "description": "Fréchet distribution logarithm of cumulative distribution function (CDF).",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -37,21 +37,22 @@
37
37
  "url": "https://github.com/stdlib-js/stdlib/issues"
38
38
  },
39
39
  "dependencies": {
40
- "@stdlib/constants-float64-ninf": "^0.0.x",
41
- "@stdlib/math-base-assert-is-nan": "^0.0.x",
42
- "@stdlib/math-base-special-pow": "^0.0.x",
43
- "@stdlib/utils-constant-function": "^0.0.x",
44
- "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x"
40
+ "@stdlib/constants-float64-ninf": "^0.2.0",
41
+ "@stdlib/math-base-assert-is-nan": "^0.2.0",
42
+ "@stdlib/math-base-special-pow": "^0.2.0",
43
+ "@stdlib/utils-constant-function": "^0.2.0",
44
+ "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.0"
45
45
  },
46
46
  "devDependencies": {
47
- "@stdlib/bench": "^0.0.x",
48
- "@stdlib/constants-float64-eps": "^0.0.x",
49
- "@stdlib/constants-float64-pinf": "^0.0.x",
50
- "@stdlib/math-base-special-abs": "^0.0.x",
51
- "@stdlib/random-base-randu": "^0.0.x",
47
+ "@stdlib/constants-float64-eps": "^0.1.1",
48
+ "@stdlib/constants-float64-pinf": "^0.1.1",
49
+ "@stdlib/math-base-special-abs": "^0.1.1",
50
+ "@stdlib/random-base-randu": "^0.1.0",
52
51
  "tape": "git+https://github.com/kgryte/tape.git#fix/globby",
53
52
  "istanbul": "^0.4.1",
54
- "tap-spec": "5.x.x"
53
+ "tap-min": "git+https://github.com/Planeshifter/tap-min.git",
54
+ "@stdlib/bench-harness": "^0.2.0",
55
+ "@stdlib/bench": "^0.3.1"
55
56
  },
56
57
  "engines": {
57
58
  "node": ">=0.10.0",
@@ -92,7 +93,7 @@
92
93
  "continuous"
93
94
  ],
94
95
  "funding": {
95
- "type": "patreon",
96
- "url": "https://www.patreon.com/athan"
96
+ "type": "opencollective",
97
+ "url": "https://opencollective.com/stdlib"
97
98
  }
98
99
  }
package/docs/repl.txt DELETED
@@ -1,83 +0,0 @@
1
-
2
- {{alias}}( x, α, s, m )
3
- Evaluates the natural logarithm of the cumulative distribution function
4
- (CDF) for a Fréchet distribution with shape parameter `α`, scale parameter
5
- `s`, and location `m`.
6
-
7
- If provided `NaN` as any argument, the function returns `NaN`.
8
-
9
- If provided `α <= 0` or `s <= 0`, the function returns `NaN`.
10
-
11
- Parameters
12
- ----------
13
- x: number
14
- Input value.
15
-
16
- α: number
17
- Shape parameter.
18
-
19
- s: number
20
- Scale parameter.
21
-
22
- m: number
23
- Location parameter.
24
-
25
- Returns
26
- -------
27
- out: number
28
- Evaluated logCDF.
29
-
30
- Examples
31
- --------
32
- > var y = {{alias}}( 10.0, 2.0, 3.0, 0.0 )
33
- ~-0.09
34
- > y = {{alias}}( -1.0, 2.0, 3.0, -3.0 )
35
- ~-2.25
36
- > y = {{alias}}( 2.5, 2.0, 1.0, 2.0 )
37
- -4.0
38
- > y = {{alias}}( NaN, 1.0, 1.0, 0.0 )
39
- NaN
40
- > y = {{alias}}( 0.0, NaN, 1.0, 0.0 )
41
- NaN
42
- > y = {{alias}}( 0.0, 1.0, NaN, 0.0 )
43
- NaN
44
- > y = {{alias}}( 0.0, 1.0, 1.0, NaN )
45
- NaN
46
- > y = {{alias}}( 0.0, -1.0, 1.0, 0.0 )
47
- NaN
48
- > y = {{alias}}( 0.0, 1.0, -1.0, 0.0 )
49
- NaN
50
-
51
-
52
- {{alias}}.factory( α, s, m )
53
- Returns a function for evaluating the natural logarithm of the cumulative
54
- distribution function (CDF) of a Fréchet distribution with shape parameter
55
- `α`, scale parameter `s`, and location `m`.
56
-
57
- Parameters
58
- ----------
59
- α: number
60
- Shape parameter.
61
-
62
- s: number
63
- Scale parameter.
64
-
65
- m: number
66
- Location parameter.
67
-
68
- Returns
69
- -------
70
- logcdf: Function
71
- Logarithm of cumulative distribution function (CDF).
72
-
73
- Examples
74
- --------
75
- > var mylogcdf = {{alias}}.factory( 3.0, 3.0, 5.0 );
76
- > var y = mylogcdf( 10.0 )
77
- ~-0.216
78
- > y = mylogcdf( 7.0 )
79
- ~-3.375
80
-
81
- See Also
82
- --------
83
-
@@ -1,141 +0,0 @@
1
- /*
2
- * @license Apache-2.0
3
- *
4
- * Copyright (c) 2019 The Stdlib Authors.
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */
18
-
19
- import logcdf = require( './index' );
20
-
21
-
22
- // TESTS //
23
-
24
- // The function returns a number...
25
- {
26
- logcdf( 2, 2, 4, -1 ); // $ExpectType number
27
- logcdf( 1, 2, 8, -1 ); // $ExpectType number
28
- }
29
-
30
- // The compiler throws an error if the function is provided values other than four numbers...
31
- {
32
- logcdf( true, 3, 6, 1 ); // $ExpectError
33
- logcdf( false, 2, 4, 3 ); // $ExpectError
34
- logcdf( '5', 1, 2, 1.5 ); // $ExpectError
35
- logcdf( [], 1, 2, 1.5 ); // $ExpectError
36
- logcdf( {}, 2, 4, 3 ); // $ExpectError
37
- logcdf( ( x: number ): number => x, 2, 4, 3 ); // $ExpectError
38
-
39
- logcdf( 9, true, 12, 1 ); // $ExpectError
40
- logcdf( 9, false, 12, 0 ); // $ExpectError
41
- logcdf( 5, '5', 10, -1 ); // $ExpectError
42
- logcdf( 8, [], 16, 1 ); // $ExpectError
43
- logcdf( 9, {}, 18, 1 ); // $ExpectError
44
- logcdf( 8, ( x: number ): number => x, 16, 8 ); // $ExpectError
45
-
46
- logcdf( 9, 5, true, 8 ); // $ExpectError
47
- logcdf( 9, 5, false, 9 ); // $ExpectError
48
- logcdf( 5, 2, '5', 0 ); // $ExpectError
49
- logcdf( 8, 4, [], 0 ); // $ExpectError
50
- logcdf( 9, 4, {}, 0 ); // $ExpectError
51
- logcdf( 8, 5, ( x: number ): number => x, 8 ); // $ExpectError
52
-
53
- logcdf( 9, 5, 10, true ); // $ExpectError
54
- logcdf( 9, 5, 10, false ); // $ExpectError
55
- logcdf( 5, 2, 4, '5' ); // $ExpectError
56
- logcdf( 8, 4, 8, [] ); // $ExpectError
57
- logcdf( 9, 4, 8, {} ); // $ExpectError
58
- logcdf( 8, 5, 10, ( x: number ): number => x ); // $ExpectError
59
- }
60
-
61
- // The compiler throws an error if the function is provided an unsupported number of arguments...
62
- {
63
- logcdf(); // $ExpectError
64
- logcdf( 2 ); // $ExpectError
65
- logcdf( 2, 0 ); // $ExpectError
66
- logcdf( 2, 0, 4 ); // $ExpectError
67
- logcdf( 2, 0, 4, 1, 5 ); // $ExpectError
68
- }
69
-
70
- // Attached to main export is a `factory` method which returns a function...
71
- {
72
- logcdf.factory( 3, 5, -1 ); // $ExpectType Unary
73
- }
74
-
75
- // The `factory` method returns a function which returns a number...
76
- {
77
- const fcn = logcdf.factory( 3, 5, -1 );
78
- fcn( 2 ); // $ExpectType number
79
- }
80
-
81
- // The compiler throws an error if the function returned by the `factory` method is provided invalid arguments...
82
- {
83
- const fcn = logcdf.factory( 3, 5, -1 );
84
- fcn( true ); // $ExpectError
85
- fcn( false ); // $ExpectError
86
- fcn( '5' ); // $ExpectError
87
- fcn( [] ); // $ExpectError
88
- fcn( {} ); // $ExpectError
89
- fcn( ( x: number ): number => x ); // $ExpectError
90
- }
91
-
92
- // The compiler throws an error if the function returned by the `factory` method is provided an unsupported number of arguments...
93
- {
94
- const fcn = logcdf.factory( 3, 5, 4 );
95
- fcn(); // $ExpectError
96
- fcn( 2, 0 ); // $ExpectError
97
- fcn( 2, 0, 1 ); // $ExpectError
98
- }
99
-
100
- // The compiler throws an error if the `factory` method is provided values other than three numbers...
101
- {
102
- logcdf.factory( true, 3, 2 ); // $ExpectError
103
- logcdf.factory( false, 3, 2 ); // $ExpectError
104
- logcdf.factory( '5', 1, 0.5 ); // $ExpectError
105
- logcdf.factory( [], 1, 0.5 ); // $ExpectError
106
- logcdf.factory( {}, 2, 0.5 ); // $ExpectError
107
- logcdf.factory( ( x: number ): number => x, 2, 1 ); // $ExpectError
108
-
109
- logcdf.factory( 9, true, 2 ); // $ExpectError
110
- logcdf.factory( 9, false, 2 ); // $ExpectError
111
- logcdf.factory( 5, '5', 3 ); // $ExpectError
112
- logcdf.factory( 8, [], 3 ); // $ExpectError
113
- logcdf.factory( 9, {}, 3 ); // $ExpectError
114
- logcdf.factory( 8, ( x: number ): number => x, 3 ); // $ExpectError
115
-
116
- logcdf.factory( 9, 10, true ); // $ExpectError
117
- logcdf.factory( 9, 18, false ); // $ExpectError
118
- logcdf.factory( 5, 10, '5' ); // $ExpectError
119
- logcdf.factory( 8, 16, [] ); // $ExpectError
120
- logcdf.factory( 9, 18, {} ); // $ExpectError
121
- logcdf.factory( 8, 16, ( x: number ): number => x ); // $ExpectError
122
-
123
- logcdf.factory( [], true, 3 ); // $ExpectError
124
- logcdf.factory( {}, false, 3 ); // $ExpectError
125
- logcdf.factory( false, '5', 3 ); // $ExpectError
126
- logcdf.factory( {}, [], 3 ); // $ExpectError
127
- logcdf.factory( '5', ( x: number ): number => x, 3 ); // $ExpectError
128
-
129
- logcdf.factory( [], true, [] ); // $ExpectError
130
- logcdf.factory( {}, false, {} ); // $ExpectError
131
- logcdf.factory( false, '5', false ); // $ExpectError
132
- logcdf.factory( {}, [], '1' ); // $ExpectError
133
- logcdf.factory( '5', ( x: number ): number => x, ( x: number ): number => x ); // $ExpectError
134
- }
135
-
136
- // The compiler throws an error if the `factory` method is provided an unsupported number of arguments...
137
- {
138
- logcdf.factory( 0 ); // $ExpectError
139
- logcdf.factory( 0, 4 ); // $ExpectError
140
- logcdf.factory( 0, 4, 3, 7 ); // $ExpectError
141
- }
File without changes