Skip to content

Commit 2d23f9a

Browse files
committed
chore: clean-up
1 parent 0fdd5dd commit 2d23f9a

File tree

9 files changed

+17
-14
lines changed

9 files changed

+17
-14
lines changed

lib/node_modules/@stdlib/number/float32/base/signbit/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ var signbitf = require( '@stdlib/number/float32/base/signbit' );
3232

3333
#### signbitf( x )
3434

35-
Returns a `boolean` indicating if the sign bit for a [single-precision floating-point number][ieee754] is on (`true`) or off (`false`).
35+
Returns a boolean indicating if the sign bit for a [single-precision floating-point number][ieee754] is on (`true`) or off (`false`).
3636

3737
```javascript
3838
var toFloat32 = require( '@stdlib/number/float64/base/to-float32' );
@@ -110,7 +110,7 @@ for ( i = 0; i < 100; i++ ) {
110110

111111
#### stdlib_base_float32_signbit( x )
112112

113-
Returns an integer indicating whether the sign bit for a float-precision floating-point number is on (`1`) or off (`0`).
113+
Returns an integer indicating whether the sign bit for a single-precision floating-point number is on (`1`) or off (`0`).
114114

115115
```c
116116
#include <stdint.h>
@@ -151,7 +151,7 @@ int8_t stdlib_base_float32_signbit( const float x );
151151
#include <inttypes.h>
152152
153153
int main( void ) {
154-
float x[] = { 3.14f, -3.14f, 0.0f, -0.0f, 4.0f, 1.0f, -1.0f, 1.0e308f, -1.0e308f };
154+
float x[] = { 3.14f, -3.14f, 0.0f, -0.0f, 4.0f, 1.0f, -1.0f, 1.0e38f, -1.0e38f };
155155
156156
int8_t out;
157157
int i;

lib/node_modules/@stdlib/number/float32/base/signbit/benchmark/c/benchmark.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ static float rand_float( void ) {
9393
static double benchmark( void ) {
9494
double elapsed;
9595
int8_t out;
96-
float x;
9796
double t;
97+
float x;
9898
int i;
9999

100100
t = tic();

lib/node_modules/@stdlib/number/float32/base/signbit/docs/types/index.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@
2626
*
2727
* @example
2828
* var toFloat32 = require( '@stdlib/number/float64/base/to-float32' );
29+
*
2930
* var bool = signbitf( toFloat32( 4.0 ) );
3031
* // returns false
3132
*
3233
* @example
3334
* var toFloat32 = require( '@stdlib/number/float64/base/to-float32' );
35+
*
3436
* var bool = signbitf( toFloat32( -9.14e-34 ) );
3537
* // returns true
3638
*

lib/node_modules/@stdlib/number/float32/base/signbit/examples/c/example.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <inttypes.h>
2323

2424
int main( void ) {
25-
const float x[] = { 3.14f, -3.14f, 0.0f, -0.0f, 4.0f, 1.0f, -1.0f, 1.0e308f, -1.0e308f };
25+
const float x[] = { 3.14f, -3.14f, 0.0f, -0.0f, 4.0f, 1.0f, -1.0f, 1.0e38f, -1.0e38f };
2626

2727
int8_t out;
2828
int i;

lib/node_modules/@stdlib/number/float32/base/signbit/include/stdlib/number/float32/base/signbit.h

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

3131
/**
32-
* Returns an integer indicating whether the sign bit for a float-precision floating-point number is on (`1`) or off (`0`).
32+
* Returns an integer indicating whether the sign bit for a single-precision floating-point number is on (`1`) or off (`0`).
3333
*/
3434
int8_t stdlib_base_float32_signbit( const float x );
3535

lib/node_modules/@stdlib/number/float32/base/signbit/lib/main.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ var toWord = require( '@stdlib/number/float32/base/to-word' );
3333
*
3434
* @example
3535
* var toFloat32 = require( '@stdlib/number/float64/base/to-float32' );
36+
*
3637
* var bool = signbitf( toFloat32( 4.0 ) );
3738
* // returns false
3839
*
3940
* @example
4041
* var toFloat32 = require( '@stdlib/number/float64/base/to-float32' );
42+
*
4143
* var bool = signbitf( toFloat32( -9.14e-34 ) );
4244
* // returns true
4345
*

lib/node_modules/@stdlib/number/float32/base/signbit/lib/native.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,14 @@ var addon = require( './../src/addon.node' );
3535
*
3636
* @example
3737
* var toFloat32 = require( '@stdlib/number/float64/base/to-float32' );
38+
*
3839
* var bool = signbitf( toFloat32( 4.0 ) );
3940
* // returns false
4041
*
4142
* @example
4243
* var toFloat32 = require( '@stdlib/number/float64/base/to-float32' );
43-
* var bool = signbitf( toFloat32( -9.14e-307 ) );
44+
*
45+
* var bool = signbitf( toFloat32( -9.14e-34 ) );
4446
* // returns true
4547
*
4648
* @example

lib/node_modules/@stdlib/number/float32/base/signbit/src/addon.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,11 @@ static napi_value addon( napi_env env, napi_callback_info info ) {
5959
return NULL;
6060
}
6161

62-
float value;
63-
double temp;
64-
status = napi_get_value_double( env, argv[ 0 ], &temp );
62+
double value;
63+
status = napi_get_value_double( env, argv[ 0 ], &value );
6564
assert( status == napi_ok );
6665

67-
value = (float)temp;
68-
69-
int8_t out = stdlib_base_float32_signbit( value );
66+
int8_t out = stdlib_base_float32_signbit( (float)value );
7067

7168
napi_value v;
7269
status = napi_create_int32( env, (int8_t)out, &v );

lib/node_modules/@stdlib/number/float32/base/signbit/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
int8_t stdlib_base_float32_signbit( const float x ) {
3535
uint32_t w;
3636

37-
// Extract from the input value a higher order word (unsigned 32-bit integer) containing the exponent and sign:
37+
// Convert the floating-point value to a word (unsigned 32-bit integer) containing the exponent and sign:
3838
stdlib_base_float32_to_word( x, &w );
3939

4040
// Shift off all bits which are not the sign bit and check if the sign bit is on:

0 commit comments

Comments
 (0)