Fix utils.ceil_log with invalid log values

This commit is contained in:
Florian Bruhin 2018-10-16 12:29:49 +02:00
parent ca7c53d4df
commit 5840b60967

View File

@ -719,6 +719,8 @@ def ceil_log(number, base):
Use only integer arithmetic in order to avoid numerical error.
"""
if number < 1 or base < 2:
raise ValueError("math domain error")
result = 1
accum = base
while accum < number: