diff --git a/lib/node_modules/@stdlib/number/float16/base/sub/README.md b/lib/node_modules/@stdlib/number/float16/base/sub/README.md index 02fb5c84b9f0..e539314ac64f 100644 --- a/lib/node_modules/@stdlib/number/float16/base/sub/README.md +++ b/lib/node_modules/@stdlib/number/float16/base/sub/README.md @@ -98,6 +98,104 @@ logEachMap( 'x: %f, y: %f => %f', x, y, sub ); + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/number/float16/base/sub.h" +``` + +#### stdlib_base_float16_mul( x, y ) + +Subtract two half-precision floating-point numbers. + +```c +#include "stdlib/number/float16/ctor.h" + +stdlib_float16_t x = stdlib_float16_from_bits( 17664 ); // => 5.0 +stdlib_float16_t y = stdlib_float16_from_bits( 16384 ); // => 2.0 + +stdlib_float16_t v = stdlib_base_float16_sub( x, y ); +``` + +The function accepts the following arguments: + +- **x**: `[in] stdlib_float16_t` first input value. +- **y**: `[in] stdlib_float16_t` second input value. + +```c +stdlib_float16_t stdlib_base_float16_sub( const stdlib_float16_t x, const stdlib_float16_t y ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/number/float16/base/sub.h" +#include "stdlib/number/float16/ctor.h" +#include "stdlib/number/float32/base/to_float16.h" +#include "stdlib/number/float16/base/to_float32.h" +#include + +int main( void ) { + const float x[] = { 3.14f, -3.14f, 0.0f, 0.0f/0.0f }; + const float y[] = { 3.14f, -3.14f, -0.0f, 0.0f/0.0f }; + + stdlib_float16_t v; + stdlib_float16_t w; + stdlib_float16_t z; + int i; + for ( i = 0; i < 4; i++ ) { + v = stdlib_base_float32_to_float16( x[ i ]); + w = stdlib_base_float32_to_float16( y[ i ]); + z = stdlib_base_float16_sub( v, w ); + printf( "%f - %f = %f\n", stdlib_base_float16_to_float32( v ), stdlib_base_float16_to_float32( w ), stdlib_base_float16_to_float32( z ) ); + } +} +``` + +
+ + + +
+ + +