Skip to content

Commit b81a36b

Browse files
committed
feat: add complete implementation
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
2 parents c4b41b7 + a77fb9e commit b81a36b

File tree

202 files changed

+2987
-1920
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

202 files changed

+2987
-1920
lines changed

docs/contributing/FAQ.md

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ limitations under the License.
2727
- [How can I set up my development environment to contribute to stdlib?](#setup-dev-environment)
2828
- [How can I install cppcheck?](#install-cppcheck)
2929
- [I am seeing different return values in the JavaScript and C implementation for the same implementation.](#js-vs-c-return-values)
30-
- [What should I do if Markdown linting on my commits fails because my headings exceed the maximum permissible length?](#markdown-heading-length)
30+
- [What should I do if linting on my commits fails because my headings or lines exceed the maximum permissible length?](#markdown-heading-length)
31+
- [What should I do if JavaScript linting on my commits fails because my function exceeds the maximum permissible number of parameters?](#max-params)
3132
- [I have opened a pull request, where can I seek feedback?](#pr-feedback)
3233
- [I need to generate fixtures for my tests. How can I do that, and what are the best references for inspiration?](#generate-fixtures)
3334
- [I am facing a `Shadowed declaration` linting error in my C files, how can I fix it?](#shadowed-declaration)
@@ -64,8 +65,6 @@ There are primarily two options for setting up your development environment to c
6465

6566
Note: The dev container does not yet support ARM64 architectures. For more information, or if you're interested in adding ARM64 support, you can visit this [issue][devcontainer-issue].
6667

67-
TODO: Modify the dev container setup link to the exact file link once it is merged.
68-
6968
<a name="install-cppcheck"></a>
7069

7170
## How can I install cppcheck?
@@ -101,15 +100,37 @@ If they pass, adjust the tolerance and add a note to the C tests indicating that
101100

102101
<a name="markdown-heading-length"></a>
103102

104-
## What should I do if Markdown linting on my commits fails because my headings exceed the maximum permissible length?
103+
## What should I do if linting on my commits fails because my headings or lines exceed the maximum permissible length?
104+
105+
Consider whether the heading/line can be shortened by renaming variables (e.g., changing `strideX` to `sx`). If shortening is not possible, disable the lint rule at the top level using:
106+
107+
- For JavaScript files:
105108

106-
Consider whether the heading can be shortened by renaming variables (e.g., changing `strideX` to `sx`). If shortening is not possible, disable the lint rule at the top level using:
109+
```javascript
110+
// eslint-disable-line max-len
111+
```
112+
113+
[Reference Comment][javascript-len-ref]
114+
115+
- For Markdown files:
107116

108117
```markdown
109118
<!-- lint disable maximum-heading-length -->
110119
```
111120

112-
TODO: Can we add a reference PR link?
121+
[Reference Comment][markdown-len-ref]
122+
123+
<a name="markdown-heading-length"></a>
124+
125+
## What should I do if JavaScript linting on my commits fails because my function exceeds the maximum permissible number of parameters?
126+
127+
Consider whether the number of parameters can be reduced. If reduction is not possible, disable the lint rule at the top level using:
128+
129+
```javascript
130+
// eslint-disable-line max-params
131+
```
132+
133+
[Reference Comment][javascript-params-ref]
113134

114135
<a name="pr-feedback"></a>
115136

@@ -386,6 +407,12 @@ For more `make` commands, refer to the [documentation][benchmark] on running ben
386407

387408
[make-commands]: https://github.com/stdlib-js/stdlib/tree/develop/tools/make/lib
388409

410+
[markdown-len-ref]: https://github.com/stdlib-js/stdlib/blob/78e0cfd8b6c0429a443b07fd39fa9dd53bf44d23/lib/node_modules/%40stdlib/lapack/base/dgttrf/README.md?plain=1#L94
411+
412+
[javascript-len-ref]: https://github.com/stdlib-js/stdlib/blob/78e0cfd8b6c0429a443b07fd39fa9dd53bf44d23/lib/node_modules/%40stdlib/lapack/base/dgttrf/lib/base.js#L111
413+
414+
[javascript-params-ref]: https://github.com/stdlib-js/stdlib/blob/78e0cfd8b6c0429a443b07fd39fa9dd53bf44d23/lib/node_modules/%40stdlib/lapack/base/dgttrf/lib/base.js#L75
415+
389416
</section>
390417

391418
<!-- /.links -->
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
<!--
2+
3+
@license Apache-2.0
4+
5+
Copyright (c) 2025 The Stdlib Authors.
6+
7+
Licensed under the Apache License, Version 2.0 (the "License");
8+
you may not use this file except in compliance with the License.
9+
You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing, software
14+
distributed under the License is distributed on an "AS IS" BASIS,
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
See the License for the specific language governing permissions and
17+
limitations under the License.
18+
19+
-->
20+
21+
# FLOAT32_PI_SQUARED
22+
23+
> [π][@stdlib/constants/float32/pi]².
24+
25+
<section class="usage">
26+
27+
## Usage
28+
29+
```javascript
30+
var FLOAT32_PI_SQUARED = require( '@stdlib/constants/float32/pi-squared' );
31+
```
32+
33+
#### FLOAT32_PI_SQUARED
34+
35+
Square of the mathematical constant [π][@stdlib/constants/float32/pi].
36+
37+
```javascript
38+
var bool = ( FLOAT32_PI_SQUARED === 9.869604110717773 );
39+
// returns true
40+
```
41+
42+
</section>
43+
44+
<!-- /.usage -->
45+
46+
<section class="examples">
47+
48+
## Examples
49+
50+
<!-- TODO: better example -->
51+
52+
<!-- eslint no-undef: "error" -->
53+
54+
```javascript
55+
var FLOAT32_PI_SQUARED = require( '@stdlib/constants/float32/pi-squared' );
56+
57+
console.log( FLOAT32_PI_SQUARED );
58+
// => 9.869604110717773
59+
```
60+
61+
</section>
62+
63+
<!-- /.examples -->
64+
65+
<!-- C interface documentation. -->
66+
67+
* * *
68+
69+
<section class="c">
70+
71+
## C APIs
72+
73+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
74+
75+
<section class="intro">
76+
77+
</section>
78+
79+
<!-- /.intro -->
80+
81+
<!-- C usage documentation. -->
82+
83+
<section class="usage">
84+
85+
### Usage
86+
87+
```c
88+
#include "stdlib/constants/float32/pi_squared.h"
89+
```
90+
91+
#### STDLIB_CONSTANT_FLOAT32_PI_SQUARED
92+
93+
Macro for the square of the mathematical constant [π][@stdlib/constants/float32/pi].
94+
95+
</section>
96+
97+
<!-- /.usage -->
98+
99+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
100+
101+
<section class="notes">
102+
103+
</section>
104+
105+
<!-- /.notes -->
106+
107+
<!-- C API usage examples. -->
108+
109+
<section class="examples">
110+
111+
</section>
112+
113+
<!-- /.examples -->
114+
115+
</section>
116+
117+
<!-- /.c -->
118+
119+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
120+
121+
<section class="related">
122+
123+
</section>
124+
125+
<!-- /.related -->
126+
127+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
128+
129+
<section class="links">
130+
131+
[@stdlib/constants/float32/pi]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/constants/float32/pi
132+
133+
</section>
134+
135+
<!-- /.links -->
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
{{alias}}
3+
Square of the mathematical constant `π`.
4+
5+
Examples
6+
--------
7+
> {{alias}}
8+
9.869604110717773
9+
10+
See Also
11+
--------
12+
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 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+
// TypeScript Version: 4.1
20+
21+
/**
22+
* Square of the mathematical constant `π`.
23+
*
24+
* @example
25+
* var val = FLOAT32_PI_SQUARED;
26+
* // returns 9.869604110717773
27+
*/
28+
declare const FLOAT32_PI_SQUARED: number;
29+
30+
31+
// EXPORTS //
32+
33+
export = FLOAT32_PI_SQUARED;
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 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 FLOAT32_PI_SQUARED = require( './index' );
20+
21+
22+
// TESTS //
23+
24+
// The export is a number...
25+
{
26+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
27+
FLOAT32_PI_SQUARED; // $ExpectType number
28+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 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+
'use strict';
20+
21+
var FLOAT32_PI_SQUARED = require( './../lib' );
22+
23+
console.log( FLOAT32_PI_SQUARED );
24+
// => 9.869604110717773
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 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+
#ifndef STDLIB_CONSTANTS_FLOAT32_PI_SQUARED_H
20+
#define STDLIB_CONSTANTS_FLOAT32_PI_SQUARED_H
21+
22+
/**
23+
* Macro for π².
24+
*/
25+
#define STDLIB_CONSTANT_FLOAT32_PI_SQUARED 9.869604401089358f
26+
27+
#endif // !STDLIB_CONSTANTS_FLOAT32_PI_SQUARED_H
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 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+
'use strict';
20+
21+
/**
22+
* Square of the mathematical constant `π`.
23+
*
24+
* @module @stdlib/constants/float32/pi-squared
25+
* @type {number}
26+
*
27+
* @example
28+
* var FLOAT32_PI_SQUARED = require( '@stdlib/constants/float32/pi-squared' );
29+
* // returns 9.869604110717773
30+
*/
31+
32+
// MODULES //
33+
34+
var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );
35+
36+
37+
// MAIN //
38+
39+
/**
40+
* Square of the mathematical constant `π`.
41+
*
42+
* @constant
43+
* @type {number}
44+
* @default 9.869604110717773
45+
* @see [Wikipedia]{@link https://en.wikipedia.org/wiki/Pi}
46+
*/
47+
var FLOAT32_PI_SQUARED = float64ToFloat32( 9.869604401089358 );
48+
49+
50+
// EXPORTS //
51+
52+
module.exports = FLOAT32_PI_SQUARED;

0 commit comments

Comments
 (0)