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
Loading
Please register or sign in to comment