def _next_regular(target):
 if (target <= 6):
  return target
 if (not (target & (target - 1))):
  return target
 match = float('inf')
 p5 = 1
 while (p5 < target):
  p35 = p5
  while (p35 < target):
   quotient = (- ((- target) // p35))
   try:
    p2 = (2 ** (quotient - 1).bit_length())
   except AttributeError:
    p2 = (2 ** _bit_length_26((quotient - 1)))
   N = (p2 * p35)
   if (N == target):
    return N
   elif (N < match):
    match = N
   p35 *= 3
   if (p35 == target):
    return p35
  if (p35 < match):
   match = p35
  p5 *= 5
  if (p5 == target):
   return p5
 if (p5 < match):
  match = p5
 return match

def _next_regular ( target ) : if ( target <= 6 ) : return target if ( not ( target & ( target - 1 ) ) ) : return target match = float ( 'inf' ) p5 = 1 while ( p5 < target ) : p35 = p5 while ( p35 < target ) : quotient = ( - ( ( - target ) // p35 ) ) try : p2 = ( 2 ** ( quotient - 1 ) . bit_length ( ) ) except AttributeError : p2 = ( 2 ** _bit_length_26 ( ( quotient - 1 ) ) ) N = ( p2 * p35 ) if ( N == target ) : return N elif ( N < match ) : match = N p35 *= 3 if ( p35 == target ) : return p35 if ( p35 < match ) : match = p35 p5 *= 5 if ( p5 == target ) : return p5 if ( p5 < match ) : match = p5 return match
find the next regular number greater than or equal to target .