Maximum limit upto which we can place digit . If tight is false , means number has already become smaller so we can place any digit , otherwise N [ pos ]
let upper_limit = ( tight == 1 ) ? ( N [ pos ] - ' ' ) : 9 ; let new_tight ;