Skip to content

Commit 26f3b59

Browse files
Neerajpathak07kgryte
authored andcommitted
feat: add constants/float32/apery
PR-URL: stdlib-js#6304 Ref: stdlib-js#649 Co-authored-by: Athan Reines <[email protected]> Reviewed-by: Athan Reines <[email protected]> Signed-off-by: Athan Reines <[email protected]>
1 parent 1217f0a commit 26f3b59

File tree

11 files changed

+577
-0
lines changed

11 files changed

+577
-0
lines changed
+160
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
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_APERY
22+
23+
> [Apéry's constant][apery-constant].
24+
25+
<section class="intro">
26+
27+
[Apéry's constant][apery-constant] is defined as
28+
29+
<!-- <equation class="equation" label="eq:apery_constant" align="center" raw="\zeta(3) = \sum_{n=1}^\infty \frac{1}{n^3} = \lim_{n\to\infty} \biggl(\frac{1}{1^3} + \frac{1}{2^3} + \cdots + \frac{1}{n^3}\biggr)" alt="Apéry's constant"> -->
30+
31+
```math
32+
\zeta(3) = \sum_{n=1}^\infty \frac{1}{n^3} = \lim_{n\to\infty} \biggl(\frac{1}{1^3} + \frac{1}{2^3} + \cdots + \frac{1}{n^3}\biggr)
33+
```
34+
35+
<!-- <div class="equation" align="center" data-raw-text="\zeta(3) = \sum_{n=1}^\infty \frac{1}{n^3} = \lim_{n\to\infty} \biggl(\frac{1}{1^3} + \frac{1}{2^3} + \cdots + \frac{1}{n^3}\biggr)" data-equation="eq:apery_constant">
36+
<img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@6e1cf583c4854b3d982f22f361f53a30c9f552dc/lib/node_modules/@stdlib/constants/float32/apery/docs/img/equation_apery_constant.svg" alt="Apéry's constant">
37+
<br>
38+
</div> -->
39+
40+
<!-- </equation> -->
41+
42+
where `ζ(s)` is the [Riemann zeta function][@stdlib/math/base/special/riemann-zeta].
43+
44+
</section>
45+
46+
<!-- /.intro -->
47+
48+
<section class="usage">
49+
50+
## Usage
51+
52+
```javascript
53+
var FLOAT32_APERY = require( '@stdlib/constants/float32/apery' );
54+
```
55+
56+
#### FLOAT32_APERY
57+
58+
[Apéry's constant][apery-constant].
59+
60+
```javascript
61+
var bool = ( FLOAT32_APERY === 1.202056884765625 );
62+
// returns true
63+
```
64+
65+
</section>
66+
67+
<!-- /.usage -->
68+
69+
<section class="examples">
70+
71+
## Examples
72+
73+
<!-- TODO: better example -->
74+
75+
<!-- eslint no-undef: "error" -->
76+
77+
```javascript
78+
var FLOAT32_APERY = require( '@stdlib/constants/float32/apery' );
79+
80+
console.log( FLOAT32_APERY );
81+
// => 1.202056884765625
82+
```
83+
84+
</section>
85+
86+
<!-- /.examples -->
87+
88+
<!-- C interface documentation. -->
89+
90+
* * *
91+
92+
<section class="c">
93+
94+
## C APIs
95+
96+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
97+
98+
<section class="intro">
99+
100+
</section>
101+
102+
<!-- /.intro -->
103+
104+
<!-- C usage documentation. -->
105+
106+
<section class="usage">
107+
108+
### Usage
109+
110+
```c
111+
#include "stdlib/constants/float32/apery.h"
112+
```
113+
114+
#### STDLIB_CONSTANT_FLOAT32_APERY
115+
116+
Macro for [Apéry's constant][apery-constant].
117+
118+
</section>
119+
120+
<!-- /.usage -->
121+
122+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
123+
124+
<section class="notes">
125+
126+
</section>
127+
128+
<!-- /.notes -->
129+
130+
<!-- C API usage examples. -->
131+
132+
<section class="examples">
133+
134+
</section>
135+
136+
<!-- /.examples -->
137+
138+
</section>
139+
140+
<!-- /.c -->
141+
142+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
143+
144+
<section class="related">
145+
146+
</section>
147+
148+
<!-- /.related -->
149+
150+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
151+
152+
<section class="links">
153+
154+
[apery-constant]: https://en.wikipedia.org/wiki/Ap%C3%A9ry%27s_constant
155+
156+
[@stdlib/math/base/special/riemann-zeta]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/riemann-zeta
157+
158+
</section>
159+
160+
<!-- /.links -->
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
{{alias}}
3+
Apéry's constant.
4+
5+
Examples
6+
--------
7+
> {{alias}}
8+
1.202056884765625
9+
10+
See Also
11+
--------
12+
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+
* Apéry's constant.
23+
*
24+
* @example
25+
* var apery = FLOAT32_APERY;
26+
* // returns 1.202056884765625
27+
*/
28+
declare const FLOAT32_APERY: number;
29+
30+
31+
// EXPORTS //
32+
33+
export = FLOAT32_APERY;
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_APERY = 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_APERY; // $ExpectType number
28+
}
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_APERY = require( './../lib' );
22+
23+
console.log( FLOAT32_APERY );
24+
// => 1.202056884765625
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_APERY_H
20+
#define STDLIB_CONSTANTS_FLOAT32_APERY_H
21+
22+
/**
23+
* Macro for Apéry's constant.
24+
*/
25+
#define STDLIB_CONSTANT_FLOAT32_APERY 1.202056903159594285f
26+
27+
#endif // !STDLIB_CONSTANTS_FLOAT32_APERY_H

0 commit comments

Comments
 (0)