@stdlib/math-base-special-binomcoefln 0.1.0 → 0.2.1
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 +1 -1
- package/README.md +6 -3
- package/SECURITY.md +5 -0
- package/dist/index.js.map +2 -2
- package/lib/main.js +1 -1
- package/package.json +10 -24
- package/CITATION.cff +0 -30
package/NOTICE
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Copyright (c) 2016-
|
|
1
|
+
Copyright (c) 2016-2024 The Stdlib Authors.
|
package/README.md
CHANGED
|
@@ -203,7 +203,7 @@ See [LICENSE][stdlib-license].
|
|
|
203
203
|
|
|
204
204
|
## Copyright
|
|
205
205
|
|
|
206
|
-
Copyright © 2016-
|
|
206
|
+
Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
207
207
|
|
|
208
208
|
</section>
|
|
209
209
|
|
|
@@ -216,8 +216,8 @@ Copyright © 2016-2023. The Stdlib [Authors][stdlib-authors].
|
|
|
216
216
|
[npm-image]: http://img.shields.io/npm/v/@stdlib/math-base-special-binomcoefln.svg
|
|
217
217
|
[npm-url]: https://npmjs.org/package/@stdlib/math-base-special-binomcoefln
|
|
218
218
|
|
|
219
|
-
[test-image]: https://github.com/stdlib-js/math-base-special-binomcoefln/actions/workflows/test.yml/badge.svg?branch=v0.1
|
|
220
|
-
[test-url]: https://github.com/stdlib-js/math-base-special-binomcoefln/actions/workflows/test.yml?query=branch:v0.1
|
|
219
|
+
[test-image]: https://github.com/stdlib-js/math-base-special-binomcoefln/actions/workflows/test.yml/badge.svg?branch=v0.2.1
|
|
220
|
+
[test-url]: https://github.com/stdlib-js/math-base-special-binomcoefln/actions/workflows/test.yml?query=branch:v0.2.1
|
|
221
221
|
|
|
222
222
|
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/math-base-special-binomcoefln/main.svg
|
|
223
223
|
[coverage-url]: https://codecov.io/github/stdlib-js/math-base-special-binomcoefln?branch=main
|
|
@@ -240,8 +240,11 @@ Copyright © 2016-2023. The Stdlib [Authors][stdlib-authors].
|
|
|
240
240
|
[es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
|
|
241
241
|
|
|
242
242
|
[deno-url]: https://github.com/stdlib-js/math-base-special-binomcoefln/tree/deno
|
|
243
|
+
[deno-readme]: https://github.com/stdlib-js/math-base-special-binomcoefln/blob/deno/README.md
|
|
243
244
|
[umd-url]: https://github.com/stdlib-js/math-base-special-binomcoefln/tree/umd
|
|
245
|
+
[umd-readme]: https://github.com/stdlib-js/math-base-special-binomcoefln/blob/umd/README.md
|
|
244
246
|
[esm-url]: https://github.com/stdlib-js/math-base-special-binomcoefln/tree/esm
|
|
247
|
+
[esm-readme]: https://github.com/stdlib-js/math-base-special-binomcoefln/blob/esm/README.md
|
|
245
248
|
[branches-url]: https://github.com/stdlib-js/math-base-special-binomcoefln/blob/main/branches.md
|
|
246
249
|
|
|
247
250
|
[stdlib-license]: https://raw.githubusercontent.com/stdlib-js/math-base-special-binomcoefln/main/LICENSE
|
package/SECURITY.md
ADDED
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../lib/main.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 isInteger = require( '@stdlib/math-base-assert-is-integer' );\nvar isnan = require( '@stdlib/math-base-assert-is-nan' );\nvar betaln = require( '@stdlib/math-base-special-betaln' );\nvar abs = require( '@stdlib/math-base-special-abs' );\nvar ln = require( '@stdlib/math-base-special-ln' );\nvar NINF = require( '@stdlib/constants-float64-ninf' );\n\n\n// MAIN //\n\n/**\n* Computes the natural logarithm of the binomial coefficient of two integers.\n*\n* @param {integer} n - input value\n* @param {integer} k - second input value\n* @returns {number} function value\n*\n* @example\n* var v = binomcoefln( 8, 2 );\n* // returns ~3.332\n*\n* @example\n* var v = binomcoefln( 0, 0 );\n* // returns 0.0\n*\n* @example\n* var v = binomcoefln( -4, 2 );\n* // returns ~2.303\n*\n* @example\n* var v = binomcoefln( 88, 3 );\n* // returns ~11.606\n*\n* @example\n* var v = binomcoefln( NaN, 3 );\n* // returns NaN\n*\n* @example\n* var v = binomcoefln( 5, NaN );\n* // returns NaN\n*\n* @example\n* var v = binomcoefln( NaN, NaN );\n* // returns NaN\n*/\nfunction binomcoefln( n, k ) {\n\tif ( isnan( n ) || isnan( k ) ) {\n\t\treturn NaN;\n\t}\n\tif ( !isInteger( n ) || !isInteger( k ) ) {\n\t\treturn NaN;\n\t}\n\tif ( n < 0.0 ) {\n\t\treturn binomcoefln( -n + k - 1
|
|
5
|
-
"mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAY,QAAS,qCAAsC,EAC3DC,EAAQ,QAAS,iCAAkC,EACnDC,EAAS,QAAS,kCAAmC,EACrDC,EAAM,QAAS,+BAAgC,EAC/CC,EAAK,QAAS,8BAA+B,EAC7CC,EAAO,QAAS,gCAAiC,EAwCrD,SAASC,EAAaC,EAAGC,EAAI,CAC5B,OAAKP,EAAOM,CAAE,GAAKN,EAAOO,CAAE,EACpB,IAEH,CAACR,EAAWO,CAAE,GAAK,CAACP,EAAWQ,CAAE,EAC9B,IAEHD,EAAI,EACDD,EAAa,CAACC,EAAIC,EAAI,
|
|
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 isInteger = require( '@stdlib/math-base-assert-is-integer' );\nvar isnan = require( '@stdlib/math-base-assert-is-nan' );\nvar betaln = require( '@stdlib/math-base-special-betaln' );\nvar abs = require( '@stdlib/math-base-special-abs' );\nvar ln = require( '@stdlib/math-base-special-ln' );\nvar NINF = require( '@stdlib/constants-float64-ninf' );\n\n\n// MAIN //\n\n/**\n* Computes the natural logarithm of the binomial coefficient of two integers.\n*\n* @param {integer} n - input value\n* @param {integer} k - second input value\n* @returns {number} function value\n*\n* @example\n* var v = binomcoefln( 8, 2 );\n* // returns ~3.332\n*\n* @example\n* var v = binomcoefln( 0, 0 );\n* // returns 0.0\n*\n* @example\n* var v = binomcoefln( -4, 2 );\n* // returns ~2.303\n*\n* @example\n* var v = binomcoefln( 88, 3 );\n* // returns ~11.606\n*\n* @example\n* var v = binomcoefln( NaN, 3 );\n* // returns NaN\n*\n* @example\n* var v = binomcoefln( 5, NaN );\n* // returns NaN\n*\n* @example\n* var v = binomcoefln( NaN, NaN );\n* // returns NaN\n*/\nfunction binomcoefln( n, k ) {\n\tif ( isnan( n ) || isnan( k ) ) {\n\t\treturn NaN;\n\t}\n\tif ( !isInteger( n ) || !isInteger( k ) ) {\n\t\treturn NaN;\n\t}\n\tif ( n < 0.0 ) {\n\t\treturn binomcoefln( -n + k - 1, k );\n\t}\n\tif ( k < 0 ) {\n\t\treturn NINF;\n\t}\n\tif ( k === 0 ) {\n\t\treturn 0.0;\n\t}\n\tif ( k === 1 ) {\n\t\treturn ln( abs( n ) );\n\t}\n\tif ( n < k ) {\n\t\treturn NINF;\n\t}\n\tif ( n - k < 2 ) {\n\t\treturn binomcoefln( n, n - k );\n\t}\n\t// Case: n - k >= 2\n\treturn -ln( n + 1 ) - betaln( n - k + 1, k + 1 );\n}\n\n\n// EXPORTS //\n\nmodule.exports = binomcoefln;\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* Compute the natural logarithm of the binomial coefficient.\n*\n* @module @stdlib/math-base-special-binomcoefln\n*\n* @example\n* var binomcoefln = require( '@stdlib/math-base-special-binomcoefln' );\n*\n* var v = binomcoefln( 8, 2 );\n* // returns ~3.332\n*\n* v = binomcoefln( 0, 0 );\n* // returns 0.0\n*\n* v = binomcoefln( -4, 2 );\n* // returns ~2.302\n*\n* v = binomcoefln( 88, 3 );\n* // returns ~11.606\n*\n* v = binomcoefln( NaN, 3 );\n* // returns NaN\n*\n* v = binomcoefln( 5, NaN );\n* // returns NaN\n*\n* v = binomcoefln( NaN, NaN );\n* // returns NaN\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
|
|
5
|
+
"mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAY,QAAS,qCAAsC,EAC3DC,EAAQ,QAAS,iCAAkC,EACnDC,EAAS,QAAS,kCAAmC,EACrDC,EAAM,QAAS,+BAAgC,EAC/CC,EAAK,QAAS,8BAA+B,EAC7CC,EAAO,QAAS,gCAAiC,EAwCrD,SAASC,EAAaC,EAAGC,EAAI,CAC5B,OAAKP,EAAOM,CAAE,GAAKN,EAAOO,CAAE,EACpB,IAEH,CAACR,EAAWO,CAAE,GAAK,CAACP,EAAWQ,CAAE,EAC9B,IAEHD,EAAI,EACDD,EAAa,CAACC,EAAIC,EAAI,EAAGA,CAAE,EAE9BA,EAAI,EACDH,EAEHG,IAAM,EACH,EAEHA,IAAM,EACHJ,EAAID,EAAKI,CAAE,CAAE,EAEhBA,EAAIC,EACDH,EAEHE,EAAIC,EAAI,EACLF,EAAaC,EAAGA,EAAIC,CAAE,EAGvB,CAACJ,EAAIG,EAAI,CAAE,EAAIL,EAAQK,EAAIC,EAAI,EAAGA,EAAI,CAAE,CAChD,CAKAT,EAAO,QAAUO,IC/CjB,IAAIG,EAAO,IAKX,OAAO,QAAUA",
|
|
6
6
|
"names": ["require_main", "__commonJSMin", "exports", "module", "isInteger", "isnan", "betaln", "abs", "ln", "NINF", "binomcoefln", "n", "k", "main"]
|
|
7
7
|
}
|
package/lib/main.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stdlib/math-base-special-binomcoefln",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Compute the natural logarithm of the binomial coefficient.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -15,19 +15,12 @@
|
|
|
15
15
|
],
|
|
16
16
|
"main": "./lib",
|
|
17
17
|
"directories": {
|
|
18
|
-
"benchmark": "./benchmark",
|
|
19
18
|
"doc": "./docs",
|
|
20
|
-
"example": "./examples",
|
|
21
19
|
"lib": "./lib",
|
|
22
|
-
"
|
|
20
|
+
"dist": "./dist"
|
|
23
21
|
},
|
|
24
22
|
"types": "./docs/types",
|
|
25
|
-
"scripts": {
|
|
26
|
-
"test": "make test",
|
|
27
|
-
"test-cov": "make test-cov",
|
|
28
|
-
"examples": "make examples",
|
|
29
|
-
"benchmark": "make benchmark"
|
|
30
|
-
},
|
|
23
|
+
"scripts": {},
|
|
31
24
|
"homepage": "https://stdlib.io",
|
|
32
25
|
"repository": {
|
|
33
26
|
"type": "git",
|
|
@@ -37,21 +30,14 @@
|
|
|
37
30
|
"url": "https://github.com/stdlib-js/stdlib/issues"
|
|
38
31
|
},
|
|
39
32
|
"dependencies": {
|
|
40
|
-
"@stdlib/constants-float64-ninf": "^0.1
|
|
41
|
-
"@stdlib/math-base-assert-is-integer": "^0.1
|
|
42
|
-
"@stdlib/math-base-assert-is-nan": "^0.1
|
|
43
|
-
"@stdlib/math-base-special-abs": "^0.1
|
|
44
|
-
"@stdlib/math-base-special-betaln": "^0.1
|
|
45
|
-
"@stdlib/math-base-special-ln": "^0.1
|
|
46
|
-
},
|
|
47
|
-
"devDependencies": {
|
|
48
|
-
"@stdlib/bench": "^0.1.0",
|
|
49
|
-
"@stdlib/math-base-special-round": "^0.1.0",
|
|
50
|
-
"@stdlib/random-base-randu": "^0.0.8",
|
|
51
|
-
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
|
|
52
|
-
"istanbul": "^0.4.1",
|
|
53
|
-
"tap-min": "git+https://github.com/Planeshifter/tap-min.git"
|
|
33
|
+
"@stdlib/constants-float64-ninf": "^0.2.1",
|
|
34
|
+
"@stdlib/math-base-assert-is-integer": "^0.2.1",
|
|
35
|
+
"@stdlib/math-base-assert-is-nan": "^0.2.1",
|
|
36
|
+
"@stdlib/math-base-special-abs": "^0.2.1",
|
|
37
|
+
"@stdlib/math-base-special-betaln": "^0.2.1",
|
|
38
|
+
"@stdlib/math-base-special-ln": "^0.2.1"
|
|
54
39
|
},
|
|
40
|
+
"devDependencies": {},
|
|
55
41
|
"engines": {
|
|
56
42
|
"node": ">=0.10.0",
|
|
57
43
|
"npm": ">2.7.0"
|
package/CITATION.cff
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
cff-version: 1.2.0
|
|
2
|
-
title: stdlib
|
|
3
|
-
message: >-
|
|
4
|
-
If you use this software, please cite it using the
|
|
5
|
-
metadata from this file.
|
|
6
|
-
|
|
7
|
-
type: software
|
|
8
|
-
|
|
9
|
-
authors:
|
|
10
|
-
- name: The Stdlib Authors
|
|
11
|
-
url: https://github.com/stdlib-js/stdlib/graphs/contributors
|
|
12
|
-
|
|
13
|
-
repository-code: https://github.com/stdlib-js/stdlib
|
|
14
|
-
url: https://stdlib.io
|
|
15
|
-
|
|
16
|
-
abstract: |
|
|
17
|
-
Standard library for JavaScript and Node.js.
|
|
18
|
-
|
|
19
|
-
keywords:
|
|
20
|
-
- JavaScript
|
|
21
|
-
- Node.js
|
|
22
|
-
- TypeScript
|
|
23
|
-
- standard library
|
|
24
|
-
- scientific computing
|
|
25
|
-
- numerical computing
|
|
26
|
-
- statistical computing
|
|
27
|
-
|
|
28
|
-
license: Apache-2.0 AND BSL-1.0
|
|
29
|
-
|
|
30
|
-
date-released: 2016
|