From 7a45af25fd7a775d956b8d3eb03908a966a315bc Mon Sep 17 00:00:00 2001 From: Aman Singh Date: Fri, 12 Dec 2025 08:25:43 +0530 Subject: [PATCH 1/5] feat: add constants/float64/inv-two-pi --- .../constants/float64/inv-two-pi/README.md | 79 +++++++++++++++++++ .../float64/inv-two-pi/docs/repl.txt | 12 +++ .../float64/inv-two-pi/docs/types/index.d.ts | 33 ++++++++ .../float64/inv-two-pi/docs/types/test.ts | 28 +++++++ .../float64/inv-two-pi/examples/index.js | 24 ++++++ .../constants/float64/inv-two-pi/lib/index.js | 48 +++++++++++ .../constants/float64/inv-two-pi/package.json | 69 ++++++++++++++++ .../constants/float64/inv-two-pi/test/test.js | 47 +++++++++++ 8 files changed, 340 insertions(+) create mode 100644 lib/node_modules/@stdlib/constants/float64/inv-two-pi/README.md create mode 100644 lib/node_modules/@stdlib/constants/float64/inv-two-pi/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/constants/float64/inv-two-pi/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/constants/float64/inv-two-pi/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/constants/float64/inv-two-pi/examples/index.js create mode 100644 lib/node_modules/@stdlib/constants/float64/inv-two-pi/lib/index.js create mode 100644 lib/node_modules/@stdlib/constants/float64/inv-two-pi/package.json create mode 100644 lib/node_modules/@stdlib/constants/float64/inv-two-pi/test/test.js diff --git a/lib/node_modules/@stdlib/constants/float64/inv-two-pi/README.md b/lib/node_modules/@stdlib/constants/float64/inv-two-pi/README.md new file mode 100644 index 000000000000..02405a92ea62 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float64/inv-two-pi/README.md @@ -0,0 +1,79 @@ + + +# FLOAT64_INV_TWO_PI + +> Inverse of twice the mathematical constant [π][pi] (1/(2π)). + +
+ +## Usage + +```javascript +var FLOAT64_INV_TWO_PI = require( '@stdlib/constants/float64/inv-two-pi' ); +``` + +#### FLOAT64_INV_TWO_PI + +Inverse of twice the mathematical constant [π][pi] (1/(2π)). + +```javascript +var bool = ( FLOAT64_INV_TWO_PI === 0.15915494309189535 ); +// returns true +``` + +
+ + + +
+ +## Examples + + + +```javascript +var FLOAT64_INV_TWO_PI = require( '@stdlib/constants/float64/inv-two-pi' ); + +console.log( FLOAT64_INV_TWO_PI ); +// => 0.15915494309189535 +``` + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/constants/float64/inv-two-pi/docs/repl.txt b/lib/node_modules/@stdlib/constants/float64/inv-two-pi/docs/repl.txt new file mode 100644 index 000000000000..acea373664f0 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float64/inv-two-pi/docs/repl.txt @@ -0,0 +1,12 @@ + +{{alias}} + Inverse of twice the mathematical constant `π` (1/(2π)). + + Examples + -------- + > {{alias}} + 0.15915494309189535 + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/constants/float64/inv-two-pi/docs/types/index.d.ts b/lib/node_modules/@stdlib/constants/float64/inv-two-pi/docs/types/index.d.ts new file mode 100644 index 000000000000..34d34f1e26cf --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float64/inv-two-pi/docs/types/index.d.ts @@ -0,0 +1,33 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/** +* Inverse of twice the mathematical constant `π` (1/(2π)). +* +* @example +* var val = FLOAT64_INV_TWO_PI; +* // returns 0.15915494309189535 +*/ +declare const FLOAT64_INV_TWO_PI: number; + + +// EXPORTS // + +export = FLOAT64_INV_TWO_PI; diff --git a/lib/node_modules/@stdlib/constants/float64/inv-two-pi/docs/types/test.ts b/lib/node_modules/@stdlib/constants/float64/inv-two-pi/docs/types/test.ts new file mode 100644 index 000000000000..e5f86b4a95cb --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float64/inv-two-pi/docs/types/test.ts @@ -0,0 +1,28 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +import FLOAT64_INV_TWO_PI = require( './index' ); + + +// TESTS // + +// The export is a number... +{ + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + FLOAT64_INV_TWO_PI; // $ExpectType number +} diff --git a/lib/node_modules/@stdlib/constants/float64/inv-two-pi/examples/index.js b/lib/node_modules/@stdlib/constants/float64/inv-two-pi/examples/index.js new file mode 100644 index 000000000000..cbfd33e7d9aa --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float64/inv-two-pi/examples/index.js @@ -0,0 +1,24 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +var FLOAT64_INV_TWO_PI = require( './../lib' ); + +console.log( FLOAT64_INV_TWO_PI ); +// => 0.15915494309189535 diff --git a/lib/node_modules/@stdlib/constants/float64/inv-two-pi/lib/index.js b/lib/node_modules/@stdlib/constants/float64/inv-two-pi/lib/index.js new file mode 100644 index 000000000000..5e51ffbc8e73 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float64/inv-two-pi/lib/index.js @@ -0,0 +1,48 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Inverse of twice the mathematical constant `π` (1/(2π)). +* +* @module @stdlib/constants/float64/inv-two-pi +* @type {number} +* +* @example +* var FLOAT64_INV_TWO_PI = require( '@stdlib/constants/float64/inv-two-pi' ); +* // returns 0.15915494309189535 +*/ + + +// MAIN // + +/** +* Inverse of twice the mathematical constant `π` (1/(2π)). +* +* @constant +* @type {number} +* @default 0.15915494309189535 +* @see [Wikipedia]{@link https://en.wikipedia.org/wiki/Pi} +*/ +var FLOAT64_INV_TWO_PI = 0.15915494309189533576888376337251436203445964574045644874766734405889679763422653509534861042142103174415371554; // eslint-disable-line max-len + + +// EXPORTS // + +module.exports = FLOAT64_INV_TWO_PI; diff --git a/lib/node_modules/@stdlib/constants/float64/inv-two-pi/package.json b/lib/node_modules/@stdlib/constants/float64/inv-two-pi/package.json new file mode 100644 index 000000000000..aca756bbedcb --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float64/inv-two-pi/package.json @@ -0,0 +1,69 @@ +{ + "name": "@stdlib/constants/float64/inv-two-pi", + "version": "0.0.0", + "description": "Inverse of 2π (1/(2π)).", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "./lib", + "directories": { + "doc": "./docs", + "example": "./examples", + "lib": "./lib", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "constant", + "const", + "mathematics", + "math", + "inverse", + "inv", + "pi", + "two-pi", + "2pi", + "ieee754", + "double", + "dbl", + "precision", + "floating-point", + "float64" + ] +} diff --git a/lib/node_modules/@stdlib/constants/float64/inv-two-pi/test/test.js b/lib/node_modules/@stdlib/constants/float64/inv-two-pi/test/test.js new file mode 100644 index 000000000000..593544e06e6f --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float64/inv-two-pi/test/test.js @@ -0,0 +1,47 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var abs = require( '@stdlib/math/base/special/abs' ); +var FLOAT64_INV_TWO_PI = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a number', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof FLOAT64_INV_TWO_PI, 'number', 'main export is a number' ); + t.end(); +}); + +tape( 'the exported value is a double-precision floating-point number equal to 0.15915494309189535', function test( t ) { + t.strictEqual( FLOAT64_INV_TWO_PI, 0.15915494309189535, 'returns expected value' ); + t.end(); +}); + +tape( 'the exported value equals 1/(2*PI) within double-precision tolerance', function test( t ) { + var expected = 1.0 / ( 2.0 * 3.141592653589793 ); + var delta = abs( FLOAT64_INV_TWO_PI - expected ); + var tol = 1.0e-15; // double-precision tolerance + t.ok( delta <= tol, 'within tolerance. expected: '+expected+'. actual: '+FLOAT64_INV_TWO_PI+'. delta: '+delta+'. tol: '+tol+'.' ); + t.end(); +}); From cc26a22fed2875215557e599fca2caf3146b89f5 Mon Sep 17 00:00:00 2001 From: Aman Singh Date: Fri, 12 Dec 2025 09:06:32 +0530 Subject: [PATCH 2/5] feat: add constants/float64/inv-two-pi --- .../stdlib/constants/float64/inv_two_pi.h | 27 ++++++++++++++ .../float64/inv-two-pi/manifest.json | 36 +++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 lib/node_modules/@stdlib/constants/float64/inv-two-pi/include/stdlib/constants/float64/inv_two_pi.h create mode 100644 lib/node_modules/@stdlib/constants/float64/inv-two-pi/manifest.json diff --git a/lib/node_modules/@stdlib/constants/float64/inv-two-pi/include/stdlib/constants/float64/inv_two_pi.h b/lib/node_modules/@stdlib/constants/float64/inv-two-pi/include/stdlib/constants/float64/inv_two_pi.h new file mode 100644 index 000000000000..04244f5d7e78 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float64/inv-two-pi/include/stdlib/constants/float64/inv_two_pi.h @@ -0,0 +1,27 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#ifndef STDLIB_CONSTANTS_FLOAT64_INV_TWO_PI_H +#define STDLIB_CONSTANTS_FLOAT64_INV_TWO_PI_H + +/** +* Macro for the inverse of 2π (1/(2π)). +*/ +#define STDLIB_CONSTANT_FLOAT64_INV_TWO_PI 0.15915494309189533577 + +#endif // !STDLIB_CONSTANTS_FLOAT64_INV_TWO_PI_H diff --git a/lib/node_modules/@stdlib/constants/float64/inv-two-pi/manifest.json b/lib/node_modules/@stdlib/constants/float64/inv-two-pi/manifest.json new file mode 100644 index 000000000000..844d692f6439 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float64/inv-two-pi/manifest.json @@ -0,0 +1,36 @@ +{ + "options": {}, + "fields": [ + { + "field": "src", + "resolve": true, + "relative": true + }, + { + "field": "include", + "resolve": true, + "relative": true + }, + { + "field": "libraries", + "resolve": false, + "relative": false + }, + { + "field": "libpath", + "resolve": true, + "relative": false + } + ], + "confs": [ + { + "src": [], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [] + } + ] +} From fdcc9c9c1271deee420ca1f20d06b98053a5c66c Mon Sep 17 00:00:00 2001 From: Aman Singh Date: Fri, 12 Dec 2025 09:16:02 +0530 Subject: [PATCH 3/5] fix: add include directory to package.json --- .../@stdlib/constants/float64/inv-two-pi/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/node_modules/@stdlib/constants/float64/inv-two-pi/package.json b/lib/node_modules/@stdlib/constants/float64/inv-two-pi/package.json index aca756bbedcb..879b4cefe4ce 100644 --- a/lib/node_modules/@stdlib/constants/float64/inv-two-pi/package.json +++ b/lib/node_modules/@stdlib/constants/float64/inv-two-pi/package.json @@ -17,6 +17,7 @@ "directories": { "doc": "./docs", "example": "./examples", + "include": "./include", "lib": "./lib", "test": "./test" }, From 2c4a5816fa9e1e88a814018bac0160113fffba33 Mon Sep 17 00:00:00 2001 From: Aman Singh Date: Fri, 12 Dec 2025 09:39:29 +0530 Subject: [PATCH 4/5] fix: correct precision for float64 inv-two-pi to match IEEE 754 --- .../inv-two-pi/include/stdlib/constants/float64/inv_two_pi.h | 2 +- .../@stdlib/constants/float64/inv-two-pi/lib/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/constants/float64/inv-two-pi/include/stdlib/constants/float64/inv_two_pi.h b/lib/node_modules/@stdlib/constants/float64/inv-two-pi/include/stdlib/constants/float64/inv_two_pi.h index 04244f5d7e78..37d4423d4c77 100644 --- a/lib/node_modules/@stdlib/constants/float64/inv-two-pi/include/stdlib/constants/float64/inv_two_pi.h +++ b/lib/node_modules/@stdlib/constants/float64/inv-two-pi/include/stdlib/constants/float64/inv_two_pi.h @@ -22,6 +22,6 @@ /** * Macro for the inverse of 2π (1/(2π)). */ -#define STDLIB_CONSTANT_FLOAT64_INV_TWO_PI 0.15915494309189533577 +#define STDLIB_CONSTANT_FLOAT64_INV_TWO_PI 0.15915494309189535 #endif // !STDLIB_CONSTANTS_FLOAT64_INV_TWO_PI_H diff --git a/lib/node_modules/@stdlib/constants/float64/inv-two-pi/lib/index.js b/lib/node_modules/@stdlib/constants/float64/inv-two-pi/lib/index.js index 5e51ffbc8e73..47d617caae4c 100644 --- a/lib/node_modules/@stdlib/constants/float64/inv-two-pi/lib/index.js +++ b/lib/node_modules/@stdlib/constants/float64/inv-two-pi/lib/index.js @@ -40,7 +40,7 @@ * @default 0.15915494309189535 * @see [Wikipedia]{@link https://en.wikipedia.org/wiki/Pi} */ -var FLOAT64_INV_TWO_PI = 0.15915494309189533576888376337251436203445964574045644874766734405889679763422653509534861042142103174415371554; // eslint-disable-line max-len +var FLOAT64_INV_TWO_PI = 0.15915494309189535; // EXPORTS // From e44bf0b20e04807c6a1e5ad388c895caf1fa51f1 Mon Sep 17 00:00:00 2001 From: Aman Singh Date: Fri, 12 Dec 2025 10:08:14 +0530 Subject: [PATCH 5/5] docs: add C API documentation for inv-two-pi constant --- .../constants/float64/inv-two-pi/README.md | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/lib/node_modules/@stdlib/constants/float64/inv-two-pi/README.md b/lib/node_modules/@stdlib/constants/float64/inv-two-pi/README.md index 02405a92ea62..ac4a03f2fe8a 100644 --- a/lib/node_modules/@stdlib/constants/float64/inv-two-pi/README.md +++ b/lib/node_modules/@stdlib/constants/float64/inv-two-pi/README.md @@ -60,6 +60,60 @@ console.log( FLOAT64_INV_TWO_PI ); + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/constants/float64/inv_two_pi.h" +``` + +#### STDLIB_CONSTANT_FLOAT64_INV_TWO_PI + +Macro for the inverse of twice the mathematical constant [π][pi] (1/(2π)). + +
+ + + + + +
+ +
+ + + + + +
+ +
+ + + +
+ + +