def equal_devision(length, div_num):
    '\n    # 概要\n    length を div_num で分割する。\n    端数が出た場合は誤差拡散法を使って上手い具合に分散させる。\n    '
    base = (length / div_num)
    ret_array = [base for x in range(div_num)]
    diff = 0
    for idx in range(div_num):
        diff += math.modf(ret_array[idx])[0]
        if (diff >= 1.0):
            diff -= 1.0
            ret_array[idx] = int((math.floor(ret_array[idx]) + 1))
        else:
            ret_array[idx] = int(math.floor(ret_array[idx]))
    diff = (length - sum(ret_array))
    if (diff != 0):
        ret_array[(- 1)] += diff
    if (length != sum(ret_array)):
        raise ValueError('the output of equal_division() is abnormal.')
    return ret_array
# 概要
length を div_num で分割する。
端数が出た場合は誤差拡散法を使って上手い具合に分散させる。
def equal_devision(length, div_num):
    '\n    # 概要\n    length を div_num で分割する。\n    端数が出た場合は誤差拡散法を使って上手い具合に分散させる。\n    '
    base = (length / div_num)
    ret_array = [base for x in range(div_num)]
    diff = 0
    for idx in range(div_num):
        diff += math.modf(ret_array[idx])[0]
        if (diff >= 1.0):
            diff -= 1.0
            ret_array[idx] = int((math.floor(ret_array[idx]) + 1))
        else:
            ret_array[idx] = int(math.floor(ret_array[idx]))
    diff = (length - sum(ret_array))
    if (diff != 0):
        ret_array[(- 1)] += diff
    if (length != sum(ret_array)):
        raise ValueError('the output of equal_division() is abnormal.')
    return ret_array