Skip to content

Commit fa95f32

Browse files
authored
Apply suggestions from code review
Signed-off-by: Athan <[email protected]>
1 parent b656fe7 commit fa95f32

File tree

3 files changed

+3
-11
lines changed

3 files changed

+3
-11
lines changed

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,7 @@ var toFloat32 = require( '@stdlib/number/float64/base/to-float32' );
3939
* // returns 1.3369140625
4040
*/
4141
function float16ToFloat32( x ) {
42-
// Convert to float16 first to ensure we're working with half-precision:
43-
x = f16( x );
44-
45-
return toFloat32( x );
42+
return toFloat32( f16( x ) );
4643
}
4744

4845

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ var addon = require( './../src/addon.node' );
2727
// MAIN //
2828

2929
/**
30-
* Convert a half-precision floating-point number to the nearest single-precision floating-point number.
30+
* Converts a half-precision floating-point number to the nearest single-precision floating-point number.
3131
*
3232
* @private
3333
* @param {number} x - half-precision floating-point number
@@ -40,10 +40,7 @@ var addon = require( './../src/addon.node' );
4040
* // returns 1.3369140625
4141
*/
4242
function float16ToFloat32( x ) {
43-
// Convert to float16 first to ensure we're working with half-precision:
44-
x = f16( x );
45-
46-
return addon( x );
43+
return addon( f16( x ) );
4744
}
4845

4946

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
#include <stdint.h>
2727
#include <string.h>
2828

29-
// VARIABLES //
30-
3129
static const uint32_t FLOAT16_MAX_EXPONENT = 31;
3230

3331
/**

0 commit comments

Comments
 (0)