repl.txt (1073B)
1 2 {{alias}}( x ) 3 Returns a string giving the literal bit representation of an unsigned 16-bit 4 integer. 5 6 Except for typed arrays, JavaScript does not provide native user support for 7 unsigned 16-bit integers. According to the ECMAScript standard, `number` 8 values correspond to double-precision floating-point numbers. While this 9 function is intended for unsigned 16-bit integers, the function will accept 10 floating-point values and represent the values as if they are unsigned 11 16-bit integers. Accordingly, care should be taken to ensure that only 12 nonnegative integer values less than `65536` (`2^16`) are provided. 13 14 Parameters 15 ---------- 16 x: integer 17 Input value. 18 19 Returns 20 ------- 21 str: string 22 Bit representation. 23 24 Examples 25 -------- 26 > var a = new {{alias:@stdlib/array/uint16}}( [ 1, 4, 9 ] ); 27 > var str = {{alias}}( a[ 0 ] ) 28 '0000000000000001' 29 > str = {{alias}}( a[ 1 ] ) 30 '0000000000000100' 31 > str = {{alias}}( a[ 2 ] ) 32 '0000000000001001' 33 34 See Also 35 -------- 36