@stdlib/math-base-special-binomcoefln 0.1.0 → 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-2023 The Stdlib Authors.
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-2023. The Stdlib [Authors][stdlib-authors].
206
+ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
207
207
 
208
208
  </section>
209
209
 
@@ -216,8 +216,8 @@ Copyright &copy; 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.0
220
- [test-url]: https://github.com/stdlib-js/math-base-special-binomcoefln/actions/workflows/test.yml?query=branch:v0.1.0
219
+ [test-image]: https://github.com/stdlib-js/math-base-special-binomcoefln/actions/workflows/test.yml/badge.svg?branch=v0.2.0
220
+ [test-url]: https://github.com/stdlib-js/math-base-special-binomcoefln/actions/workflows/test.yml?query=branch:v0.2.0
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 &copy; 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
@@ -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).
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.0, 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,EAAKA,CAAE,EAEhCA,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",
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
@@ -73,7 +73,7 @@ function binomcoefln( n, k ) {
73
73
  return NaN;
74
74
  }
75
75
  if ( n < 0.0 ) {
76
- return binomcoefln( -n + k - 1.0, k );
76
+ return binomcoefln( -n + k - 1, k );
77
77
  }
78
78
  if ( k < 0 ) {
79
79
  return NINF;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stdlib/math-base-special-binomcoefln",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Compute the natural logarithm of the binomial coefficient.",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -37,20 +37,21 @@
37
37
  "url": "https://github.com/stdlib-js/stdlib/issues"
38
38
  },
39
39
  "dependencies": {
40
- "@stdlib/constants-float64-ninf": "^0.1.0",
41
- "@stdlib/math-base-assert-is-integer": "^0.1.0",
42
- "@stdlib/math-base-assert-is-nan": "^0.1.0",
43
- "@stdlib/math-base-special-abs": "^0.1.0",
44
- "@stdlib/math-base-special-betaln": "^0.1.0",
45
- "@stdlib/math-base-special-ln": "^0.1.0"
40
+ "@stdlib/constants-float64-ninf": "^0.2.0",
41
+ "@stdlib/math-base-assert-is-integer": "^0.2.0",
42
+ "@stdlib/math-base-assert-is-nan": "^0.2.0",
43
+ "@stdlib/math-base-special-abs": "^0.2.0",
44
+ "@stdlib/math-base-special-betaln": "^0.2.0",
45
+ "@stdlib/math-base-special-ln": "^0.2.0"
46
46
  },
47
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",
48
+ "@stdlib/math-base-special-round": "^0.2.0",
49
+ "@stdlib/random-base-randu": "^0.1.0",
51
50
  "tape": "git+https://github.com/kgryte/tape.git#fix/globby",
52
51
  "istanbul": "^0.4.1",
53
- "tap-min": "git+https://github.com/Planeshifter/tap-min.git"
52
+ "tap-min": "git+https://github.com/Planeshifter/tap-min.git",
53
+ "@stdlib/bench-harness": "^0.2.0",
54
+ "@stdlib/bench": "^0.3.1"
54
55
  },
55
56
  "engines": {
56
57
  "node": ">=0.10.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