Skip to content

Commit c7b9f1e

Browse files
committed
feat: add typescript declaration
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: passed - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed ---
1 parent 3702782 commit c7b9f1e

File tree

3 files changed

+114
-0
lines changed

3 files changed

+114
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
2+
{{alias}}( x )
3+
Evaluates the base 10 exponential function.
4+
5+
Parameters
6+
----------
7+
x: number
8+
Input value.
9+
10+
Returns
11+
-------
12+
y: number
13+
Function value.
14+
15+
Examples
16+
--------
17+
> var y = {{alias}}( 3.0 )
18+
1000
19+
> y = {{alias}}( 0.0 )
20+
1.0
21+
> y = {{alias}}( NaN )
22+
NaN
23+
24+
See Also
25+
--------
26+
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+
// TypeScript Version: 4.1
20+
21+
/**
22+
* Evaluates the base 10 exponential function.
23+
*
24+
* @param x - input value
25+
* @returns function value
26+
*
27+
* @example
28+
* var v = exp10( 3.0 );
29+
* // returns 1000.0
30+
*
31+
* @example
32+
* var v = exp10( 0.0 );
33+
* // returns 1.0
34+
*
35+
* @example
36+
* var v = exp10( NaN );
37+
* // returns NaN
38+
*/
39+
declare function exp10f( x: number ): number;
40+
41+
42+
// EXPORTS //
43+
44+
export = exp10f;
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) 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 exp10f = require( './index' );
20+
21+
22+
// TESTS //
23+
24+
// The function returns a number...
25+
{
26+
exp10f( 0.5 ); // $ExpectType number
27+
}
28+
29+
// The compiler throws an error if the function is provided a value other than a number...
30+
{
31+
exp10f( true ); // $ExpectError
32+
exp10f( false ); // $ExpectError
33+
exp10f( null ); // $ExpectError
34+
exp10f( undefined ); // $ExpectError
35+
exp10f( '5' ); // $ExpectError
36+
exp10f( [] ); // $ExpectError
37+
exp10f( {} ); // $ExpectError
38+
exp10f( ( x: number ): number => x ); // $ExpectError
39+
}
40+
41+
// The compiler throws an error if the function is provided insufficient arguments...
42+
{
43+
exp10f(); // $ExpectError
44+
}

0 commit comments

Comments
 (0)