import { Bit , UInt4 , Nibble } from '../types' ; example param { Number } nibble return { Array } export default ( nibble ) : Nibble => { if ( nibble < 16 && nibble >= 0 && Math . floor ( nibble ) === nibble ) { const result = [ 0 , 0 , 0 , 0 ] ; for ( let i = 0 ; i < 4 ; i ++ ) result [ 3 - i ] = < Bit > ( ( nibble >> i ) & 1 ) ; return result ; } else throw new RangeError ( 'invalid array length' ) ; } ;