Skip to content

Commit 70e08cd

Browse files
committed
chore: cleanup
--- 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: na - 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 6d082df commit 70e08cd

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

lib/node_modules/@stdlib/number/float16/base/to-float32/include/stdlib/number/float16/base/to_float32.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ extern "C" {
3030
#endif
3131

3232
/**
33-
* Convert a half-precision floating-point number to the nearest single-precision floating-point number.
33+
* Converts a half-precision floating-point number to the nearest single-precision floating-point number.
3434
*/
3535
float stdlib_base_float16_to_float32( const stdlib_float16_t x );
3636

lib/node_modules/@stdlib/number/float16/base/to-float32/lib/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
// MODULES //
2222

23-
var float64ToFloat16 = require( '@stdlib/number/float64/base/to-float16' );
23+
var f16 = require( '@stdlib/number/float64/base/to-float16' );
2424
var toFloat32 = require( '@stdlib/number/float64/base/to-float32' );
2525

2626

@@ -40,7 +40,7 @@ var toFloat32 = require( '@stdlib/number/float64/base/to-float32' );
4040
*/
4141
function float16ToFloat32( x ) {
4242
// Convert to float16 first to ensure we're working with half-precision:
43-
x = float64ToFloat16( x );
43+
x = f16( x );
4444

4545
return toFloat32( x );
4646
}

lib/node_modules/@stdlib/number/float16/base/to-float32/lib/native.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
// MODULES //
2222

23-
var float64ToFloat16 = require( '@stdlib/number/float64/base/to-float16' );
23+
var f16 = require( '@stdlib/number/float64/base/to-float16' );
2424
var addon = require( './../src/addon.node' );
2525

2626

@@ -41,7 +41,7 @@ var addon = require( './../src/addon.node' );
4141
*/
4242
function float16ToFloat32( x ) {
4343
// Convert to float16 first to ensure we're working with half-precision:
44-
x = float64ToFloat16( x );
44+
x = f16( x );
4545

4646
return addon( x );
4747
}

lib/node_modules/@stdlib/number/float16/base/to-float32/src/main.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
static const uint32_t FLOAT16_MAX_EXPONENT = 31;
3232

3333
/**
34-
* Convert a half-precision floating-point number to the nearest single-precision floating-point number.
34+
* Converts a half-precision floating-point number to the nearest single-precision floating-point number.
3535
*
3636
* @param x half-precision floating-point number
3737
* @return single-precision floating-point number
@@ -53,19 +53,18 @@ float stdlib_base_float16_to_float32( const stdlib_float16_t x ) {
5353

5454
f16 = stdlib_float16_to_bits( x );
5555

56-
// Extract sign bit and shift left 16 bits:
56+
// Extract sign bit and shift left 16 bits
5757
sign = ((uint32_t)(f16 & STDLIB_CONSTANT_FLOAT16_SIGN_MASK)) << 16;
5858

59-
// Extract exponent bits:
59+
// Extract exponent bits
6060
f16Exponent = (f16 & STDLIB_CONSTANT_FLOAT16_EXPONENT_MASK) >> STDLIB_CONSTANT_FLOAT16_NUM_SIGNIFICAND_BITS;
6161

62-
// Extract mantissa bits:
62+
// Extract mantissa bits
6363
f16Mantissa = f16 & STDLIB_CONSTANT_FLOAT16_SIGNIFICAND_MASK;
6464

65-
// Handle special cases...
65+
// Handle special cases
6666
if ( f16Exponent == 0 ) {
6767
if ( f16Mantissa == 0 ) {
68-
// Zero
6968
f32 = sign;
7069
memcpy( &result, &f32, sizeof(float) );
7170
return result;

0 commit comments

Comments
 (0)