You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/node_modules/@stdlib/math/base/special/tribonacci/README.md
+88Lines changed: 88 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -137,6 +137,94 @@ for ( i = 0; i < 64; i++ ) {
137
137
138
138
<!-- /.examples -->
139
139
140
+
<!-- C interface documentation. -->
141
+
142
+
* * *
143
+
144
+
<sectionclass="c">
145
+
146
+
## C APIs
147
+
148
+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
149
+
150
+
<sectionclass="intro">
151
+
152
+
</section>
153
+
154
+
<!-- /.intro -->
155
+
156
+
<!-- C usage documentation. -->
157
+
158
+
<sectionclass="usage">
159
+
160
+
### Usage
161
+
162
+
```c
163
+
#include"stdlib/math/base/special/tribonacci.h"
164
+
```
165
+
166
+
#### stdlib_base_tribonacci( n )
167
+
168
+
Computes the nth [Tribonacci number][tribonacci-number].
169
+
170
+
```c
171
+
double out = stdlib_base_tribonacci( 0 );
172
+
// returns 0
173
+
174
+
out = stdlib_base_tribonacci( 1 );
175
+
// returns 0
176
+
```
177
+
178
+
The function accepts the following arguments:
179
+
180
+
-**n**: `[in] int32_t` input value.
181
+
182
+
```c
183
+
doublestdlib_base_tribonacci( const int32_t n );
184
+
```
185
+
186
+
</section>
187
+
188
+
<!-- /.usage -->
189
+
190
+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
191
+
192
+
<section class="notes">
193
+
194
+
</section>
195
+
196
+
<!-- /.notes -->
197
+
198
+
<!-- C API usage examples. -->
199
+
200
+
<section class="examples">
201
+
202
+
### Examples
203
+
204
+
```c
205
+
#include "stdlib/math/base/special/tribonacci.h"
206
+
#include <stdio.h>
207
+
#include <stdint.h>
208
+
209
+
int main() {
210
+
int32_t i;
211
+
double v;
212
+
213
+
for ( i = 0; i < 64; i++ ) {
214
+
v = stdlib_base_tribonacci( i );
215
+
printf( "tribonacci(%d) = %lf\n", i, v );
216
+
}
217
+
}
218
+
```
219
+
220
+
</section>
221
+
222
+
<!-- /.examples -->
223
+
224
+
</section>
225
+
226
+
<!-- /.c -->
227
+
140
228
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
0 commit comments