示例#1
0
def _mul_fateman_to_int2(f_list,g_list):
    """
    Convert a polynomial to an integer by evaluating it
    INPUT: p, a list of integers
    OUTPUT: padding
    """
    max_coeff_f = max([abs(i) for i in f_list])
    max_coeff_g = max([abs(i) for i in g_list])
    b = (1+min(len(f_list),len(g_list)))*max_coeff_f*max_coeff_g
    return int(pyceil(pylog(b,2)))
示例#2
0
def _mul_fateman_to_int2(f_list,g_list):
    """
    Convert a polynomial to an integer by evaluating it
    INPUT: p, a list of integers
    OUTPUT: padding
    """
    max_coeff_f = max([abs(i) for i in f_list])
    max_coeff_g = max([abs(i) for i in g_list])
    b = (1+min(len(f_list),len(g_list)))*max_coeff_f*max_coeff_g
    return int(pyceil(pylog(b,2)))
def ceil(x):
    return int(pyceil(x))
示例#4
0
def ceil(x):
    return int(pyceil(x))