Skip to content

Commit d9eefe3

Browse files
committed
chore: add minor changes
--- 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: passed - task: lint_package_json status: passed - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - 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: missing_dependencies - 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: na - task: lint_license_headers status: passed ---
1 parent 860ebb1 commit d9eefe3

File tree

10 files changed

+131
-116
lines changed

10 files changed

+131
-116
lines changed

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

+19-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ limitations under the License.
2020

2121
# roundsd
2222

23-
> Round a numeric value to the nearest number with `n` significant figures.
23+
> Rounds a double-precision floating-point number to the nearest value with `n` significant figures.
2424
2525
<section class="usage">
2626

@@ -113,7 +113,7 @@ logEachMap( 'x: %0.4f. y: %d. Rounded: %0.4f.', x, 5, roundsd );
113113

114114
#### stdlib_base_roundsd( x, n, b )
115115

116-
Rounds a `numeric` value to the nearest `number` with `n` significant figures.
116+
Rounds a double-precision floating-point number to the nearest value with `n` significant figures.
117117

118118
```c
119119
double v = stdlib_base_roundsd( 3.141592653589793, 3, 10 );
@@ -176,6 +176,15 @@ int main( void ) {
176176

177177
<section class="related">
178178

179+
* * *
180+
181+
## See Also
182+
183+
- <span class="package-name">[`@stdlib/math/base/special/ceilsd`][@stdlib/math/base/special/ceilsd]</span><span class="delimiter">: </span><span class="description">round a numeric value to the nearest number toward positive infinity with N significant figures.</span>
184+
- <span class="package-name">[`@stdlib/math/base/special/floorsd`][@stdlib/math/base/special/floorsd]</span><span class="delimiter">: </span><span class="description">round a numeric value to the nearest number toward negative infinity with N significant figures.</span>
185+
- <span class="package-name">[`@stdlib/math/base/special/round`][@stdlib/math/base/special/round]</span><span class="delimiter">: </span><span class="description">round a numeric value to the nearest integer.</span>
186+
- <span class="package-name">[`@stdlib/math/base/special/truncsd`][@stdlib/math/base/special/truncsd]</span><span class="delimiter">: </span><span class="description">round a numeric value to the nearest number toward zero with N significant figures.</span>
187+
179188
</section>
180189

181190
<!-- /.related -->
@@ -186,6 +195,14 @@ int main( void ) {
186195

187196
<!-- <related-links> -->
188197

198+
[@stdlib/math/base/special/ceilsd]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/ceilsd
199+
200+
[@stdlib/math/base/special/floorsd]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/floorsd
201+
202+
[@stdlib/math/base/special/round]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/round
203+
204+
[@stdlib/math/base/special/truncsd]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/truncsd
205+
189206
<!-- </related-links> -->
190207

191208
</section>

lib/node_modules/@stdlib/math/base/special/roundsd/docs/repl.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
{{alias}}( x, n[, b] )
3-
Rounds a numeric value to the nearest number with `n` significant figures.
3+
Rounds a double-precision floating-point number to the nearest
4+
value with `n` significant figures.
45

56
Parameters
67
----------

lib/node_modules/@stdlib/math/base/special/roundsd/docs/types/index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
// TypeScript Version: 4.1
2020

2121
/**
22-
* Rounds a numeric value to the nearest number with \\(n\\) significant figures.
22+
* Rounds a double-precision floating-point number to the nearest value with `n` significant figures.
2323
*
2424
* @param x - input value
2525
* @param n - number of significant figures

lib/node_modules/@stdlib/math/base/special/roundsd/include/stdlib/math/base/special/roundsd.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ extern "C" {
2929
#endif
3030

3131
/**
32-
* Rounds a numeric value to the nearest number with \\(n\\) significant figures.
32+
* Rounds a double-precision floating-point number to the nearest value with \\(n\\) significant figures.
3333
*/
3434
double stdlib_base_roundsd( const double x, const int32_t n, const int32_t b );
3535

lib/node_modules/@stdlib/math/base/special/roundsd/lib/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
'use strict';
2020

2121
/**
22-
* Round a numeric value to the nearest number with `n` significant figures.
22+
* Round a double-precision floating-point number to the nearest value with `n` significant figures.
2323
*
2424
* @module @stdlib/math/base/special/roundsd
2525
*

lib/node_modules/@stdlib/math/base/special/roundsd/lib/main.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ var round = require( '@stdlib/math/base/special/round' );
3434
// MAIN //
3535

3636
/**
37-
* Rounds a numeric value to the nearest number with \\(n\\) significant figures.
37+
* Rounds a double-precision floating-point number to the nearest value with `n` significant figures.
3838
*
3939
* @param {number} x - input value
4040
* @param {PositiveInteger} n - number of significant figures

lib/node_modules/@stdlib/math/base/special/roundsd/lib/native.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var addon = require( './../src/addon.node' );
2626
// MAIN //
2727

2828
/**
29-
* Rounds a numeric value to the nearest number with \\(n\\) significant figures.
29+
* Rounds a double-precision floating-point number to the nearest value with `n` significant figures.
3030
*
3131
* @private
3232
* @param {number} x - input value
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,102 @@
11
{
2-
"options": {
3-
"task": "build"
2+
"options": {
3+
"task": "build"
4+
},
5+
"fields": [
6+
{
7+
"field": "src",
8+
"resolve": true,
9+
"relative": true
410
},
5-
"fields": [
6-
{
7-
"field": "src",
8-
"resolve": true,
9-
"relative": true
10-
},
11-
{
12-
"field": "include",
13-
"resolve": true,
14-
"relative": true
15-
},
16-
{
17-
"field": "libraries",
18-
"resolve": false,
19-
"relative": false
20-
},
21-
{
22-
"field": "libpath",
23-
"resolve": true,
24-
"relative": false
25-
}
26-
],
27-
"confs": [
28-
{
29-
"task": "build",
30-
"src": [
31-
"./src/main.c"
32-
],
33-
"include": [
34-
"./include"
35-
],
36-
"libraries": [
37-
"-lm"
38-
],
39-
"libpath": [],
40-
"dependencies": [
41-
"@stdlib/math/base/napi/ternary",
42-
"@stdlib/math/base/special/abs",
43-
"@stdlib/math/base/special/pow",
44-
"@stdlib/math/base/special/log10",
45-
"@stdlib/math/base/special/ln",
46-
"@stdlib/math/base/special/floor",
47-
"@stdlib/number/float64/base/exponent",
48-
"@stdlib/math/base/assert/is-infinite",
49-
"@stdlib/math/base/special/round",
50-
"@stdlib/math/base/assert/is-nan"
51-
]
52-
},
53-
{
54-
"task": "benchmark",
55-
"src": [
56-
"./src/main.c"
57-
],
58-
"include": [
59-
"./include"
60-
],
61-
"libraries": [
62-
"-lm"
63-
],
64-
"libpath": [],
65-
"dependencies": [
66-
"@stdlib/math/base/special/abs",
67-
"@stdlib/math/base/special/pow",
68-
"@stdlib/math/base/special/log10",
69-
"@stdlib/math/base/special/ln",
70-
"@stdlib/math/base/special/floor",
71-
"@stdlib/number/float64/base/exponent",
72-
"@stdlib/math/base/assert/is-infinite",
73-
"@stdlib/math/base/special/round",
74-
"@stdlib/math/base/assert/is-nan"
75-
]
76-
},
77-
{
78-
"task": "examples",
79-
"src": [
80-
"./src/main.c"
81-
],
82-
"include": [
83-
"./include"
84-
],
85-
"libraries": [
86-
"-lm"
87-
],
88-
"libpath": [],
89-
"dependencies": [
90-
"@stdlib/math/base/special/abs",
91-
"@stdlib/math/base/special/pow",
92-
"@stdlib/math/base/special/log10",
93-
"@stdlib/math/base/special/ln",
94-
"@stdlib/math/base/special/floor",
95-
"@stdlib/number/float64/base/exponent",
96-
"@stdlib/math/base/assert/is-infinite",
97-
"@stdlib/math/base/special/round",
98-
"@stdlib/math/base/assert/is-nan"
99-
]
100-
}
101-
]
102-
}
11+
{
12+
"field": "include",
13+
"resolve": true,
14+
"relative": true
15+
},
16+
{
17+
"field": "libraries",
18+
"resolve": false,
19+
"relative": false
20+
},
21+
{
22+
"field": "libpath",
23+
"resolve": true,
24+
"relative": false
25+
}
26+
],
27+
"confs": [
28+
{
29+
"task": "build",
30+
"src": [
31+
"./src/main.c"
32+
],
33+
"include": [
34+
"./include"
35+
],
36+
"libraries": [
37+
"-lm"
38+
],
39+
"libpath": [],
40+
"dependencies": [
41+
"@stdlib/math/base/napi/ternary",
42+
"@stdlib/math/base/special/abs",
43+
"@stdlib/math/base/special/pow",
44+
"@stdlib/math/base/special/log10",
45+
"@stdlib/math/base/special/ln",
46+
"@stdlib/math/base/special/floor",
47+
"@stdlib/number/float64/base/exponent",
48+
"@stdlib/math/base/assert/is-infinite",
49+
"@stdlib/math/base/special/round",
50+
"@stdlib/math/base/assert/is-nan"
51+
]
52+
},
53+
{
54+
"task": "benchmark",
55+
"src": [
56+
"./src/main.c"
57+
],
58+
"include": [
59+
"./include"
60+
],
61+
"libraries": [
62+
"-lm"
63+
],
64+
"libpath": [],
65+
"dependencies": [
66+
"@stdlib/math/base/special/abs",
67+
"@stdlib/math/base/special/pow",
68+
"@stdlib/math/base/special/log10",
69+
"@stdlib/math/base/special/ln",
70+
"@stdlib/math/base/special/floor",
71+
"@stdlib/number/float64/base/exponent",
72+
"@stdlib/math/base/assert/is-infinite",
73+
"@stdlib/math/base/special/round",
74+
"@stdlib/math/base/assert/is-nan"
75+
]
76+
},
77+
{
78+
"task": "examples",
79+
"src": [
80+
"./src/main.c"
81+
],
82+
"include": [
83+
"./include"
84+
],
85+
"libraries": [
86+
"-lm"
87+
],
88+
"libpath": [],
89+
"dependencies": [
90+
"@stdlib/math/base/special/abs",
91+
"@stdlib/math/base/special/pow",
92+
"@stdlib/math/base/special/log10",
93+
"@stdlib/math/base/special/ln",
94+
"@stdlib/math/base/special/floor",
95+
"@stdlib/number/float64/base/exponent",
96+
"@stdlib/math/base/assert/is-infinite",
97+
"@stdlib/math/base/special/round",
98+
"@stdlib/math/base/assert/is-nan"
99+
]
100+
}
101+
]
102+
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@stdlib/math/base/special/roundsd",
33
"version": "0.0.0",
4-
"description": "Round a numeric value to the nearest number with N significant figures.",
4+
"description": "Rounds a double-precision floating-point number to the nearest value with N significant figures.",
55
"license": "Apache-2.0",
66
"author": {
77
"name": "The Stdlib Authors",

lib/node_modules/@stdlib/math/base/special/roundsd/src/main.c

+4-7
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
* limitations under the License.
1717
*/
1818

19-
2019
// MODULES //
2120

2221
#include "stdlib/math/base/assert/is_nan.h"
@@ -34,12 +33,12 @@
3433
// MAIN //
3534

3635
/**
37-
* Rounds a numeric value to the nearest number with \\(n\\) significant figures.
36+
* Rounds a double-precision floating-point number to the nearest value with \\(n\\) significant figures.
3837
*
3938
* @param x input value
4039
* @param n number of significant figures
4140
* @param b base
42-
* @returns rounded value
41+
* @return rounded value
4342
*
4443
* @example
4544
* double v = stdlib_base_roundsd( 3.141592653589793, 3, 10 );
@@ -58,11 +57,9 @@ double stdlib_base_roundsd( const double x, const int32_t n, const int32_t b ) {
5857
}
5958
if ( b == 10 ) {
6059
exp = stdlib_base_log10( stdlib_base_abs( x ) );
61-
}
62-
else if ( b == 2 ) {
60+
} else if ( b == 2 ) {
6361
exp = stdlib_base_float64_exponent( stdlib_base_abs( x ) );
64-
}
65-
else {
62+
} else {
6663
exp = stdlib_base_ln( stdlib_base_abs(x) ) / stdlib_base_ln( b );
6764
}
6865
exp = stdlib_base_floor( exp - n + 1.0 );

0 commit comments

Comments
 (0)