Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 4452c78e authored by Hans Boehm's avatar Hans Boehm
Browse files

Fix exponentiation and timeout issues

Bug:33433764
Bug:33105915

Use the recursive algorithm for exponentiation with an integer
exponent and a base that cannot be determined to be positive.
Use of the log-based algorithm caused expressions like (-pi)^3
to fail. (Note that the recursive exponentiation algorithm
is essentially a clone of rawPow in BoundedRational, not a new
invention.)

Catch stack overflows during expression evaluation and treat them
as timeouts. This is a bit challenging for the underlying VM, but
it's supposed to work, and it seems to. We only rely on it in
cases that previously failed without anyone noticing, like
2^2^2^2^2^2.

Don't just write out the long timeout information. Also read it
back in. Duh.

Some drive-by comment improvements.

Change-Id: I13f84850de5d1b9323b63ae2b769a22d97d0ae66
parent f442477a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment