aureooms/js-integer-little-endian

View on GitHub
src/1-new/convert/convert_keep_zeros.js

Summary

Maintainability
A
35 mins
Test Coverage
import { _convert } from './' ;
import { _zeros } from '../array' ;

export function convert_keep_zeros ( f , t , a , ai , aj ) {

    const bi = 0 ;
    const bj = Math.ceil( Math.log( f ) / Math.log( t ) * ( aj - ai ) ) ;
    const b = _zeros( bj - bi ) ;

    _convert( f , t , a , ai , aj , b , bi , bj ) ;

    return b ;

}