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

Commit 551f8cb2 authored by Hans Boehm's avatar Hans Boehm
Browse files

Handle ln(rational multiple of e) better

Bug: 37486067

In particular, ln(e) is now a rational one.

Test: Unit tests, manual test.
Change-Id: I3cc57a4a84ec6667d3c8554c4fc234f9aa7c2e86
(cherry picked from commit bf2e69ae00d7b70562822769c100c3ddcc928b17)
parent 9223c18a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1011,6 +1011,9 @@ public class UnifiedReal {
    }

    public UnifiedReal ln() {
        if (mCrFactor == CR_E) {
            return new UnifiedReal(mRatFactor, CR_ONE).ln().add(ONE);
        }
        if (isComparable(ZERO)) {
            if (signum() <= 0) {
                throw new ArithmeticException("log(non-positive)");