Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions realalg/base_algebraic.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
from functools import total_ordering
from math import log10 as log
from numbers import Integral
import sys

import sympy as sp

from .interval import Interval
Expand All @@ -14,6 +16,12 @@
sp_QQ_x = sp.QQ.old_poly_ring(sp_x)
LOG_2 = log(2)

# By default, Python will only convert a decimal string of length at
# most 4300 to an integer to protect against DDOS attacks; not relevant
# here (CVE-2020-10735).
if hasattr(sys, 'set_int_max_str_digits'):
sys.set_int_max_str_digits(0)

def log_plus(x):
''' Return the height of the number ``x``. '''
return log(max(1, abs(x)))
Expand Down
Loading