def _apply_prefix(value, base, prefixes):
    """
	Test what's the maximum prefix we can apply to the specified
	value with the specified base
	"""
    nv = value
    np = ''
    for i in range(1, len(prefixes)):
        v = pow(base, i)
        if v >= 1:
            if v > value:
                break
        elif v < value:
            break
        nv = value / v
        np = prefixes[i]
    return nv, np
