Skip to content

Commit 3a041cb

Browse files
committed
Merge branch 'develop' of https://github.com/stdlib-js/stdlib into develop
2 parents e61fa03 + fbd56cf commit 3a041cb

File tree

96 files changed

+7629
-48
lines changed

Some content is hidden

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

96 files changed

+7629
-48
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
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: 2.0
20+
21+
/**
22+
* Computes the nth Bernoulli number.
23+
*
24+
* @param n - the Bernoulli number to compute
25+
* @returns Bernoulli number
26+
*
27+
* @example
28+
* var y = bernoulli( 0 );
29+
* // returns 1.0
30+
*
31+
* @example
32+
* var y = bernoulli( 1 );
33+
* // returns 0.0
34+
*
35+
* @example
36+
* var y = bernoulli( 2 );
37+
* // returns ~0.167
38+
*
39+
* @example
40+
* var y = bernoulli( 3 );
41+
* // returns 0.0
42+
*
43+
* @example
44+
* var y = bernoulli( 4 );
45+
* // returns ~-0.033
46+
*
47+
* @example
48+
* var y = bernoulli( 5 );
49+
* // returns 0.0
50+
*
51+
* @example
52+
* var y = bernoulli( 20 );
53+
* // returns ~-529.124
54+
*
55+
* @example
56+
* var y = bernoulli( 260 );
57+
* // returns -Infinity
58+
*
59+
* @example
60+
* var y = bernoulli( 262 );
61+
* // returns Infinity
62+
*
63+
* @example
64+
* var y = bernoulli( NaN );
65+
* // returns NaN
66+
*/
67+
declare function bernoulli( n: number ): number;
68+
69+
70+
// EXPORTS //
71+
72+
export = bernoulli;
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 bernoulli = require( './index' );
20+
21+
22+
// TESTS //
23+
24+
// The function returns a number...
25+
{
26+
bernoulli( 8 ); // $ExpectType number
27+
}
28+
29+
// The function does not compile if provided a value other than a number...
30+
{
31+
bernoulli( true ); // $ExpectError
32+
bernoulli( false ); // $ExpectError
33+
bernoulli( null ); // $ExpectError
34+
bernoulli( undefined ); // $ExpectError
35+
bernoulli( '5' ); // $ExpectError
36+
bernoulli( [] ); // $ExpectError
37+
bernoulli( {} ); // $ExpectError
38+
bernoulli( ( x: number ): number => x ); // $ExpectError
39+
}
40+
41+
// The function does not compile if provided insufficient arguments...
42+
{
43+
bernoulli(); // $ExpectError
44+
}

lib/node_modules/@stdlib/math/base/special/bernoulli/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"lib": "./lib",
2222
"test": "./test"
2323
},
24+
"types": "./docs/types",
2425
"scripts": {},
2526
"homepage": "https://github.com/stdlib-js/stdlib",
2627
"repository": {
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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: 2.0
20+
21+
/**
22+
* Computes the Bessel function of the first kind of order zero.
23+
*
24+
* @param x - input value
25+
* @returns evaluated Bessel function
26+
*
27+
* @example
28+
* var v = j0( 0.0 );
29+
* // returns 1.0
30+
*
31+
* v = j0( 1.0 );
32+
* // returns ~0.765
33+
*
34+
* v = j0( Infinity );
35+
* // returns 0.0
36+
*
37+
* v = j0( -Infinity );
38+
* // returns 0.0
39+
*
40+
* v = j0( NaN );
41+
* // returns NaN
42+
*/
43+
declare function j0( x: number ): number;
44+
45+
46+
// EXPORTS //
47+
48+
export = j0;
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 j0 = require( './index' );
20+
21+
22+
// TESTS //
23+
24+
// The function returns a number...
25+
{
26+
j0( 8 ); // $ExpectType number
27+
}
28+
29+
// The function does not compile if provided a value other than a number...
30+
{
31+
j0( true ); // $ExpectError
32+
j0( false ); // $ExpectError
33+
j0( null ); // $ExpectError
34+
j0( undefined ); // $ExpectError
35+
j0( '5' ); // $ExpectError
36+
j0( [] ); // $ExpectError
37+
j0( {} ); // $ExpectError
38+
j0( ( x: number ): number => x ); // $ExpectError
39+
}
40+
41+
// The function does not compile if provided insufficient arguments...
42+
{
43+
j0(); // $ExpectError
44+
}

lib/node_modules/@stdlib/math/base/special/besselj0/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"lib": "./lib",
2222
"test": "./test"
2323
},
24+
"types": "./docs/types",
2425
"scripts": {},
2526
"homepage": "https://github.com/stdlib-js/stdlib",
2627
"repository": {
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) 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: 2.0
20+
21+
/**
22+
* Computes the Bessel function of the first kind of order one.
23+
*
24+
* ## Notes
25+
*
26+
* - Accuracy for subnormal `x` is very poor. Full accuracy is achieved at `1.0e-308` but trends progressively to zero at `5e-324`. This suggests that underflow (or overflow, perhaps due to a reciprocal) is effectively cutting off digits of precision until the computation loses all accuracy at `5e-324`.
27+
*
28+
* @param x - input value
29+
* @returns evaluated Bessel function
30+
*
31+
* @example
32+
* var v = j1( 0.0 );
33+
* // returns 0.0
34+
*
35+
* v = j1( 1.0 );
36+
* // returns ~0.440
37+
*
38+
* v = j1( Infinity );
39+
* // returns 0.0
40+
*
41+
* v = j1( -Infinity );
42+
* // returns 0.0
43+
*
44+
* v = j1( NaN );
45+
* // returns NaN
46+
*/
47+
declare function j1( x: number ): number;
48+
49+
50+
// EXPORTS //
51+
52+
export = j1;
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 j1 = require( './index' );
20+
21+
22+
// TESTS //
23+
24+
// The function returns a number...
25+
{
26+
j1( 8 ); // $ExpectType number
27+
}
28+
29+
// The function does not compile if provided a value other than a number...
30+
{
31+
j1( true ); // $ExpectError
32+
j1( false ); // $ExpectError
33+
j1( null ); // $ExpectError
34+
j1( undefined ); // $ExpectError
35+
j1( '5' ); // $ExpectError
36+
j1( [] ); // $ExpectError
37+
j1( {} ); // $ExpectError
38+
j1( ( x: number ): number => x ); // $ExpectError
39+
}
40+
41+
// The function does not compile if provided insufficient arguments...
42+
{
43+
j1(); // $ExpectError
44+
}

lib/node_modules/@stdlib/math/base/special/besselj1/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"lib": "./lib",
2222
"test": "./test"
2323
},
24+
"types": "./docs/types",
2425
"scripts": {},
2526
"homepage": "https://github.com/stdlib-js/stdlib",
2627
"repository": {
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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: 2.0
20+
21+
/**
22+
* Computes the Bessel function of the second kind of order zero.
23+
24+
* ## Notes
25+
*
26+
* - Accuracy for subnormal `x` is very poor. Full accuracy is achieved at `1.0e-308` but trends progressively to zero at `5e-324`. This suggests that underflow (or overflow, perhaps due to a reciprocal) is effectively cutting off digits of precision until the computation loses all accuracy at `5e-324`.
27+
*
28+
* @param x - input value
29+
* @returns evaluated Bessel function
30+
*
31+
* @example
32+
* var v = y0( 0.0 );
33+
* // returns -Infinity
34+
*
35+
* v = y0( 1.0 );
36+
* // returns ~0.088
37+
*
38+
* v = y0( -1.0 );
39+
* // returns NaN
40+
*
41+
* v = y0( Infinity );
42+
* // returns 0.0
43+
*
44+
* v = y0( -Infinity );
45+
* // returns NaN
46+
*
47+
* v = y0( NaN );
48+
* // returns NaN
49+
*/
50+
declare function y0( x: number ): number;
51+
52+
53+
// EXPORTS //
54+
55+
export = y0;

0 commit comments

Comments
 (0)