diff --git a/lib/node_modules/@stdlib/number/float32/base/signbit/README.md b/lib/node_modules/@stdlib/number/float32/base/signbit/README.md index 0f70925481c0..0176e61d0c06 100644 --- a/lib/node_modules/@stdlib/number/float32/base/signbit/README.md +++ b/lib/node_modules/@stdlib/number/float32/base/signbit/README.md @@ -18,7 +18,7 @@ limitations under the License. --> -# signbit +# signbitf > Return a boolean indicating if the sign bit for a [single-precision floating-point number][ieee754] is on (true) or off (false). @@ -32,7 +32,7 @@ var signbitf = require( '@stdlib/number/float32/base/signbit' ); #### signbitf( x ) -Returns a `boolean` indicating if the sign bit for a [single-precision floating-point number][ieee754] is on (`true`) or off (`false`). +Returns a boolean indicating if the sign bit for a [single-precision floating-point number][ieee754] is on (`true`) or off (`false`). ```javascript var toFloat32 = require( '@stdlib/number/float64/base/to-float32' ); @@ -82,6 +82,88 @@ for ( i = 0; i < 100; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/number/float32/base/signbit.h" +``` + +#### stdlib_base_float32_signbit( x ) + +Returns an integer indicating whether the sign bit for a single-precision floating-point number is on (`1`) or off (`0`). + +```c +#include + +int8_t out = stdlib_base_float32_signbit( 3.14f ); +``` + +The function accepts the following arguments: + +- **x**: `[in] float` input value. + +```c +int8_t stdlib_base_float32_signbit( const float x ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/number/float32/base/signbit.h" +#include +#include +#include + +int main( void ) { + float x[] = { 3.14f, -3.14f, 0.0f, -0.0f, 4.0f, 1.0f, -1.0f, 1.0e38f, -1.0e38f }; + + int8_t out; + int i; + for ( i = 0; i < 9; i++ ) { + stdlib_base_float32_signbit( x[ i ], &out ); + printf( "%f => signbit: %" PRId8 "\n", x[ i ], out ); + } +} +``` + +
+