Loading src/com/android/calculator2/CalculatorResult.java +9 −1 Original line number Diff line number Diff line Loading @@ -744,6 +744,10 @@ public class CalculatorResult extends AlignedTextView implements MenuItem.OnMenu ++exponent; } } if (dropDigits >= result.length() - 1) { // Display too small to show meaningful result. return KeyMaps.ELLIPSIS + "E" + KeyMaps.ELLIPSIS; } result = result.substring(0, result.length() - dropDigits); if (lastDisplayedOffset != null) { lastDisplayedOffset[0] -= dropDigits; Loading Loading @@ -918,11 +922,15 @@ public class CalculatorResult extends AlignedTextView implements MenuItem.OnMenu } public void redisplay() { int maxChars = getMaxChars(); if (maxChars < 4) { // Display currently too small to display a reasonable result. Punt to avoid crash. return; } if (mScroller.isFinished() && length() > 0) { setAccessibilityLiveRegion(ACCESSIBILITY_LIVE_REGION_POLITE); } int currentCharOffset = getCharOffset(mCurrentPos); int maxChars = getMaxChars(); int lastDisplayedOffset[] = new int[1]; String result = getFormattedResult(currentCharOffset, maxChars, lastDisplayedOffset, mAppendExponent /* forcePrecision; preserve entire result */, Loading src/com/android/calculator2/Evaluator.java +4 −0 Original line number Diff line number Diff line Loading @@ -574,6 +574,10 @@ public class Evaluator implements CalculatorExpr.ExprResolver { if (res == null) { try { res = mExprInfo.mExpr.eval(mDm, Evaluator.this); if (isCancelled()) { // TODO: This remains very slightly racey. Fix this. throw new CR.AbortedException(); } res = putResultIfAbsent(mIndex, res); } catch (StackOverflowError e) { // Absurdly large integer exponents can cause this. There might be other Loading Loading
src/com/android/calculator2/CalculatorResult.java +9 −1 Original line number Diff line number Diff line Loading @@ -744,6 +744,10 @@ public class CalculatorResult extends AlignedTextView implements MenuItem.OnMenu ++exponent; } } if (dropDigits >= result.length() - 1) { // Display too small to show meaningful result. return KeyMaps.ELLIPSIS + "E" + KeyMaps.ELLIPSIS; } result = result.substring(0, result.length() - dropDigits); if (lastDisplayedOffset != null) { lastDisplayedOffset[0] -= dropDigits; Loading Loading @@ -918,11 +922,15 @@ public class CalculatorResult extends AlignedTextView implements MenuItem.OnMenu } public void redisplay() { int maxChars = getMaxChars(); if (maxChars < 4) { // Display currently too small to display a reasonable result. Punt to avoid crash. return; } if (mScroller.isFinished() && length() > 0) { setAccessibilityLiveRegion(ACCESSIBILITY_LIVE_REGION_POLITE); } int currentCharOffset = getCharOffset(mCurrentPos); int maxChars = getMaxChars(); int lastDisplayedOffset[] = new int[1]; String result = getFormattedResult(currentCharOffset, maxChars, lastDisplayedOffset, mAppendExponent /* forcePrecision; preserve entire result */, Loading
src/com/android/calculator2/Evaluator.java +4 −0 Original line number Diff line number Diff line Loading @@ -574,6 +574,10 @@ public class Evaluator implements CalculatorExpr.ExprResolver { if (res == null) { try { res = mExprInfo.mExpr.eval(mDm, Evaluator.this); if (isCancelled()) { // TODO: This remains very slightly racey. Fix this. throw new CR.AbortedException(); } res = putResultIfAbsent(mIndex, res); } catch (StackOverflowError e) { // Absurdly large integer exponents can cause this. There might be other Loading