Skip to content

Commit 994c546

Browse files
refactor: address additional review feedback for trunc2f
--- 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: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - 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 9545be1 commit 994c546

5 files changed

Lines changed: 12 additions & 11 deletions

File tree

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ limitations under the License.
2020

2121
# trunc2f
2222

23-
> Round a numeric value to the nearest power of two toward zero.
23+
> Rounds a single-precision floating-point number to the nearest power of two toward zero.
2424
2525
<section class="usage">
2626

@@ -32,7 +32,7 @@ var trunc2f = require( '@stdlib/math/base/special/trunc2f' );
3232

3333
#### trunc2f( x )
3434

35-
Rounds a `numeric` value to the nearest power of two toward zero.
35+
Rounds a single-precision floating-point number value to the nearest power of two toward zero.
3636

3737
```javascript
3838
var v = trunc2f( -4.2 );
@@ -127,7 +127,7 @@ logEachMap( 'x: %0.4f. Rounded: %0.4f.', x, trunc2f );
127127

128128
#### stdlib_base_trunc2f( x )
129129

130-
Rounds a `numeric` value to the nearest power of two toward zero.
130+
Rounds a single-precision floating-point number value to the nearest power of two toward zero.
131131

132132
```c
133133
float y = stdlib_base_trunc2f( -4.2f );

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ var ONE = f32( 1.0 );
3939
// MAIN //
4040

4141
/**
42-
* Rounds a single-presicion floating-point number to the nearest power of two toward zero.
42+
* Rounds a single-precision floating-point number to the nearest power of two toward zero.
4343
*
4444
* @param {number} x - input value
4545
* @returns {number} rounded value

lib/node_modules/@stdlib/math/base/special/trunc2f/manifest.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@
6060
"dependencies": [
6161
"@stdlib/math/base/special/frexpf",
6262
"@stdlib/math/base/special/ldexpf",
63-
"@stdlib/math/base/assert/is-nan",
64-
"@stdlib/math/base/assert/is-infinite"
63+
"@stdlib/math/base/assert/is-nanf",
64+
"@stdlib/math/base/assert/is-infinitef"
6565
]
6666
},
6767
{
@@ -79,8 +79,8 @@
7979
"dependencies": [
8080
"@stdlib/math/base/special/frexpf",
8181
"@stdlib/math/base/special/ldexpf",
82-
"@stdlib/math/base/assert/is-nan",
83-
"@stdlib/math/base/assert/is-infinite"
82+
"@stdlib/math/base/assert/is-nanf",
83+
"@stdlib/math/base/assert/is-infinitef"
8484
]
8585
}
8686
]

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@
2121
#include "stdlib/math/base/assert/is_infinitef.h"
2222
#include "stdlib/math/base/special/frexpf.h"
2323
#include "stdlib/math/base/special/ldexpf.h"
24+
#include <stdint.h>
2425

2526
/**
26-
* Rounds a single-presicion floating-point number to the nearest power of two toward zero.
27+
* Rounds a single-precision floating-point number to the nearest power of two toward zero.
2728
*
2829
* @param x input value
2930
* @return rounded value
@@ -47,7 +48,7 @@ float stdlib_base_trunc2f( const float x ) {
4748
} else {
4849
sign = 1.0f;
4950
}
50-
stdlib_base_frexpf( x, &frac ,&exp );
51+
stdlib_base_frexpf( x, &frac, &exp );
5152

5253
return sign * stdlib_base_ldexpf( 1.0f, exp-1 );
5354
}

lib/node_modules/@stdlib/math/base/special/trunc2f/test/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var tape = require( 'tape' );
2424
var NINF = require( '@stdlib/constants/float32/ninf' );
2525
var PINF = require( '@stdlib/constants/float32/pinf' );
2626
var SMALLEST_SUBNORMAL = require( '@stdlib/constants/float32/smallest-subnormal' );
27-
var isnanf = require( '@stdlib/math/base/assert/is-nan' );
27+
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
2828
var isNegativeZerof = require( '@stdlib/math/base/assert/is-negative-zerof' );
2929
var isPositiveZerof = require( '@stdlib/math/base/assert/is-positive-zerof' );
3030
var exp2 = require( '@stdlib/math/base/special/exp2' );

0 commit comments

Comments
 (0)