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

Commit e7111cfb authored by Hans Boehm's avatar Hans Boehm
Browse files

Add special case for exp(1) evaluation.

Bug: 33539849

By returning a fixed value, we avoid redundant computation, and can
recognize that e.g. e - exp(1) is exactly zero.

Change-Id: Ibf8b84092ad844fa3d6b2818395c2da437fec9c8
parent 12874e38
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1062,6 +1062,10 @@ public class UnifiedReal {
        if (definitelyEquals(ZERO)) {
            return ONE;
        }
        if (definitelyEquals(ONE)) {
            // Avoid redundant computations, and ensure we recognize all instances as equal.
            return E;
        }
        final BoundedRational crExp = getExp(mCrFactor);
        if (crExp != null) {
            if (mRatFactor.signum() < 0) {