Skip to content

Commit 068757b

Browse files
author
aayush0325
committed
docs: docs added
1 parent 6a50b96 commit 068757b

File tree

5 files changed

+235
-1
lines changed

5 files changed

+235
-1
lines changed

lib/node_modules/@stdlib/math/base/special/nonfibonaccif/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ f(n) = \left \lfloor{ n + 1 + \log_\varphi \biggl( \sqrt{5}( n + 1 + \log_\varph
3535
```
3636

3737
<!-- <div class="equation" align="center" data-raw-text="f(n) = \left \lfloor{ n + 1 + \log_\varphi \biggl( \sqrt{5}( n + 1 + \log_\varphi(\sqrt{5}(n+1))) - 5 + \tfrac{3}{n+1} \biggr) - 2 } \right \rfloor" data-equation="eq:nonfibonaccif_number">
38-
<img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@bb29798906e119fcb2af99e94b60407a270c9b32/lib/node_modules/@stdlib/math/base/special/nonfibonaccif/docs/img/equation_nonfibonaccif_number.svg" alt="Formula to compute the nth non-Fibonacci number.">
38+
<img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@bb29798906e119fcb2af99e94b60407a270c9b32/lib/node_modules/@stdlib/math/base/special/nonfibonaccif/docs/img/equation_nonfibonacci_number.svg" alt="Formula to compute the nth non-Fibonacci number.">
3939
<br>
4040
</div> -->
4141

Lines changed: 97 additions & 0 deletions
Loading
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
{{alias}}( n )
3+
Computes the nth non-Fibonacci number in
4+
single-precision floating-point format.
5+
6+
If not provided a nonnegative integer value, the function returns `NaN`.
7+
8+
If provided `NaN`, the function returns `NaN`.
9+
10+
Parameters
11+
----------
12+
n: integer
13+
Input value.
14+
15+
Returns
16+
-------
17+
y: number
18+
Non-Fibonacci number.
19+
20+
Examples
21+
--------
22+
> var v = {{alias}}( 1 )
23+
4
24+
> v = {{alias}}( 2 )
25+
6
26+
> v = {{alias}}( 3 )
27+
7
28+
> v = {{alias}}( NaN )
29+
NaN
30+
31+
See Also
32+
--------
33+
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2019 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+
* Computes the nth non-Fibonacci number in single-precision floating-point format.
23+
*
24+
* ## Notes
25+
*
26+
* - If not provided a nonnegative integer value, the function returns `NaN`.
27+
*
28+
* @param n - the non-Fibonacci number to compute
29+
* @returns non-Fibonacci number
30+
*
31+
* @example
32+
* var v = nonfibonaccif( 1 );
33+
* // returns 4
34+
*
35+
* @example
36+
* var v = nonfibonaccif( 2 );
37+
* // returns 6
38+
*
39+
* @example
40+
* var v = nonfibonaccif( 3 );
41+
* // returns 7
42+
*
43+
* @example
44+
* var v = nonfibonaccif( NaN );
45+
* // returns NaN
46+
*
47+
* @example
48+
* var v = nonfibonaccif( 3.14 );
49+
* // returns NaN
50+
*
51+
* @example
52+
* var v = nonfibonaccif( -1 );
53+
* // returns NaN
54+
*/
55+
declare function nonfibonaccif( n: number ): number;
56+
57+
58+
// EXPORTS //
59+
60+
export = nonfibonaccif;
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2019 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 nonfibonaccif = require( './index' );
20+
21+
22+
// TESTS //
23+
24+
// The function returns a number...
25+
{
26+
nonfibonaccif( 8 ); // $ExpectType number
27+
}
28+
29+
// The compiler throws an error if the function is provided a value other than a number...
30+
{
31+
nonfibonaccif( true ); // $ExpectError
32+
nonfibonaccif( false ); // $ExpectError
33+
nonfibonaccif( null ); // $ExpectError
34+
nonfibonaccif( undefined ); // $ExpectError
35+
nonfibonaccif( '5' ); // $ExpectError
36+
nonfibonaccif( [] ); // $ExpectError
37+
nonfibonaccif( {} ); // $ExpectError
38+
nonfibonaccif( ( x: number ): number => x ); // $ExpectError
39+
}
40+
41+
// The compiler throws an error if the function is provided insufficient arguments...
42+
{
43+
nonfibonaccif(); // $ExpectError
44+
}

0 commit comments

Comments
 (0)