diff --git a/lib/node_modules/@stdlib/number/float16/base/from-word/README.md b/lib/node_modules/@stdlib/number/float16/base/from-word/README.md index 19a217d40eb6..cf3111893068 100644 --- a/lib/node_modules/@stdlib/number/float16/base/from-word/README.md +++ b/lib/node_modules/@stdlib/number/float16/base/from-word/README.md @@ -75,6 +75,100 @@ logEachMap( 'word: %d => float16: %f', word, pickArguments( fromWord, [ 0 ] ) ); + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/number/float16/base/from_word.h" +``` + +#### stdlib_base_float16_from_word( word, \*x ) + +Creates a [half-precision floating-point number][ieee754] from an unsigned 16-bit integer corresponding to an [IEEE 754][ieee754] binary representation. + +```c +#include "stdlib/number/float16/ctor.h" +#include + +uint16_t word = 51648; // => -11.5 + +stdlib_float16_t x; +stdlib_base_float16_from_word( word, &x ); +``` + +The function accepts the following arguments: + +- **word**: `[in] uint16_t` input word. +- **x**: `[out] stdlib_float16_t*` destination for a half-precision floating-point number. + +```c +void stdlib_base_float16_from_word( const uint16_t word, stdlib_float16_t *x ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/number/float16/base/from_word.h" +#include "stdlib/number/float16/ctor.h" +#include "stdlib/number/float32/base/to_float16.h" +#include +#include + +int main( void ) { + uint16_t word = 51648; + + stdlib_float16_t x; + int i; + for ( i = 0; i < 10; i++ ) { + stdlib_base_float16_from_word( word+(uint16_t)(i*10), &x ); + printf( "word: %u => %f\n", word, stdlib_base_float32_to_float16( x ) ); + } +} +``` + +
+ + + +
+ + +