|
| 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_CATALAN |
| 22 | + |
| 23 | +> [Catalan's constant][catalan-constant]. |
| 24 | +
|
| 25 | +<section class="intro"> |
| 26 | + |
| 27 | +[Catalan's constant][catalan-constant] `C` (also denoted `K` or `G`) commonly appears in estimates of combinatorial functions and may be defined by the following infinite series |
| 28 | + |
| 29 | +<!-- <equation class="equation" label="eq:catalan_constant" align="center" raw="C = \sum_{n=0}^{\infty} \frac{(-1)^{n}}{(2n+1)^2} = \frac{1}{1^2} - \frac{1}{3^2} + \frac{1}{5^2} - \frac{1}{7^2} + \cdots" alt="Catalan's constant"> --> |
| 30 | + |
| 31 | +```math |
| 32 | +C = \sum_{n=0}^{\infty} \frac{(-1)^{n}}{(2n+1)^2} = \frac{1}{1^2} - \frac{1}{3^2} + \frac{1}{5^2} - \frac{1}{7^2} + \cdots |
| 33 | +``` |
| 34 | + |
| 35 | +<!-- <div class="equation" align="center" data-raw-text="C = \sum_{n=0}^{\infty} \frac{(-1)^{n}}{(2n+1)^2} = \frac{1}{1^2} - \frac{1}{3^2} + \frac{1}{5^2} - \frac{1}{7^2} + \cdots" data-equation="eq:catalan_constant"> |
| 36 | + <img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@6e1cf583c4854b3d982f22f361f53a30c9f552dc/lib/node_modules/@stdlib/constants/float64/catalan/docs/img/equation_catalan_constant.svg" alt="Catalan's constant"> |
| 37 | + <br> |
| 38 | +</div> --> |
| 39 | + |
| 40 | +<!-- </equation> --> |
| 41 | + |
| 42 | +</section> |
| 43 | + |
| 44 | +<!-- /.intro --> |
| 45 | + |
| 46 | +<section class="usage"> |
| 47 | + |
| 48 | +## Usage |
| 49 | + |
| 50 | +```javascript |
| 51 | +var FLOAT32_CATALAN = require( '@stdlib/constants/float32/catalan' ); |
| 52 | +``` |
| 53 | + |
| 54 | +#### FLOAT32_CATALAN |
| 55 | + |
| 56 | +[Catalan's constant][catalan-constant]. |
| 57 | + |
| 58 | +```javascript |
| 59 | +var bool = ( FLOAT32_CATALAN === 0.9159656167030334 ); |
| 60 | +// returns true |
| 61 | +``` |
| 62 | + |
| 63 | +</section> |
| 64 | + |
| 65 | +<!-- /.usage --> |
| 66 | + |
| 67 | +<section class="examples"> |
| 68 | + |
| 69 | +## Examples |
| 70 | + |
| 71 | +<!-- TODO: better example --> |
| 72 | + |
| 73 | +<!-- eslint no-undef: "error" --> |
| 74 | + |
| 75 | +```javascript |
| 76 | +var FLOAT32_CATALAN = require( '@stdlib/constants/float32/catalan' ); |
| 77 | + |
| 78 | +console.log( FLOAT32_CATALAN ); |
| 79 | +// => 0.9159656167030334 |
| 80 | +``` |
| 81 | + |
| 82 | +</section> |
| 83 | + |
| 84 | +<!-- /.examples --> |
| 85 | + |
| 86 | +<!-- C interface documentation. --> |
| 87 | + |
| 88 | +* * * |
| 89 | + |
| 90 | +<section class="c"> |
| 91 | + |
| 92 | +## C APIs |
| 93 | + |
| 94 | +<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. --> |
| 95 | + |
| 96 | +<section class="intro"> |
| 97 | + |
| 98 | +</section> |
| 99 | + |
| 100 | +<!-- /.intro --> |
| 101 | + |
| 102 | +<!-- C usage documentation. --> |
| 103 | + |
| 104 | +<section class="usage"> |
| 105 | + |
| 106 | +### Usage |
| 107 | + |
| 108 | +```c |
| 109 | +#include "stdlib/constants/float32/catalan.h" |
| 110 | +``` |
| 111 | + |
| 112 | +#### STDLIB_CONSTANT_FLOAT32_CATALAN |
| 113 | + |
| 114 | +Macro for [Catalan's constant][catalan-constant]. |
| 115 | + |
| 116 | +</section> |
| 117 | + |
| 118 | +<!-- /.usage --> |
| 119 | + |
| 120 | +<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. --> |
| 121 | + |
| 122 | +<section class="notes"> |
| 123 | + |
| 124 | +</section> |
| 125 | + |
| 126 | +<!-- /.notes --> |
| 127 | + |
| 128 | +<!-- C API usage examples. --> |
| 129 | + |
| 130 | +<section class="examples"> |
| 131 | + |
| 132 | +</section> |
| 133 | + |
| 134 | +<!-- /.examples --> |
| 135 | + |
| 136 | +</section> |
| 137 | + |
| 138 | +<!-- /.c --> |
| 139 | + |
| 140 | +<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. --> |
| 141 | + |
| 142 | +<section class="related"> |
| 143 | + |
| 144 | +</section> |
| 145 | + |
| 146 | +<!-- /.related --> |
| 147 | + |
| 148 | +<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. --> |
| 149 | + |
| 150 | +<section class="links"> |
| 151 | + |
| 152 | +[catalan-constant]: https://en.wikipedia.org/wiki/Catalan%27s_constant |
| 153 | + |
| 154 | +</section> |
| 155 | + |
| 156 | +<!-- /.links --> |
0 commit comments