summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* am fc6db072: Merge "Cleanup of timeout handling and message" into mnc-dr-devHans Boehm2015-10-113-43/+131
|\ | | | | | | | | * commit 'fc6db0729d7f4e4570c9e56d969f4bd983065711': Cleanup of timeout handling and message
| * Merge "Cleanup of timeout handling and message" into mnc-dr-devHans Boehm2015-10-113-43/+131
| |\
| | * Cleanup of timeout handling and messageHans Boehm2015-10-113-43/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 21470513 Prevent timeout message from disappearing on rotation. Have long timeout setting survive rotation. Following Justin's suggestion, associate it with a given expression and reset when expression is cleared. This does mean that when you rotate a device displaying an expensive- -to-compute result, the device will initially display the formula for several seconds, before it redisplays the result. Previously you had to reenable the long timeout. Neither is 100% ideal. Change-Id: Ibf8e151dd37ebadf1e86adee4718e8fa8f66b975 (cherry picked from commit 5e6a0ca2fcccb9ed16a465cf2a7e30ee5f7e0e67)
* | | am d5f67fe2: Merge "Implicitly clear on incomplete keyboard input" into ↵Hans Boehm2015-10-111-7/+19
|\| | | | | | | | | | | | | | | | | | | | mnc-dr-dev * commit 'd5f67fe2d2ddabecd0618a4bc8ac899cc316ca10': Implicitly clear on incomplete keyboard input
| * | Merge "Implicitly clear on incomplete keyboard input" into mnc-dr-devHans Boehm2015-10-111-7/+19
| |\ \
| | * | Implicitly clear on incomplete keyboard inputHans Boehm2015-10-111-7/+19
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 22931305 When the calculator is in result mode, cause a typed function name to clear the display, just as touching the function on the screen would. Change-Id: I77c69737a571ad8d2e6396fa3f34d5ada324fee4 (cherry picked from commit 5d79d10734b45133be7753955afd9e5edec58a1d)
* | | am 68db0665: Merge "Generalize % operator: Handle 100+10% as expected" into ↵Hans Boehm2015-10-111-9/+71
|\| | | | | | | | | | | | | | | | | | | | mnc-dr-dev * commit '68db0665c1e0e608c23f8a35bf97b4d39305827f': Generalize % operator: Handle 100+10% as expected
| * | Merge "Generalize % operator: Handle 100+10% as expected" into mnc-dr-devHans Boehm2015-10-111-9/+71
| |\ \
| | * | Generalize % operator: Handle 100+10% as expectedHans Boehm2015-10-111-9/+71
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 22836179 Handle + or - operators specially if they are followed by a constant or pre-evaluated expression and the % operator. Since this is basically an idiomatic use of the operators, we apply it very conservatively. When in doubt we use the old interpretation. Also fixes one unrelated anachronism in a comment. Change-Id: I2f9fd26dd6c0456f0210815ef2bc1afca3a2b4d7 (cherry picked from commit 8afd0f85ed0b9fa1c96297c540cb74e6d8b9a64d)
* | | am ec7517f3: Check for decimal point after adding ellipsisHans Boehm2015-10-112-35/+37
|\| | | | | | | | | | | | | | * commit 'ec7517f38758f67233f2b06bc7bab17a8ffeccba': Check for decimal point after adding ellipsis
| * | Check for decimal point after adding ellipsisHans Boehm2015-10-112-35/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 23728152 This avoids the one case in which we displayed neither a decimal point nor an exponent, and the decimal point was not just to the right of the number. Remove a redundant test, which obscured the logic. Add a couple of suggested manual tests that helped me find a (newly introduced, not submitted) bug. Change-Id: Iead1efa0a4e8ea74512e9e1f77334f80bbcdd202 (cherry picked from commit 73ecff20d9dfd80d1cff09e0210d8987049b9df3)
* | | am e4b8ff7c: Don\'t evaluate a lone decimal point to zeroHans Boehm2015-10-111-4/+11
|\| | | | | | | | | | | | | | * commit 'e4b8ff7c9c8a041ab451cdc78a019b2a4a666b99': Don't evaluate a lone decimal point to zero
| * | Don't evaluate a lone decimal point to zeroHans Boehm2015-10-111-4/+11
| |/ | | | | | | | | | | | | | | | | | | Bug: 22917707 Make a constant consisting of just a decimal point produce an error when evaluated. Change-Id: I970c8b396894f301553171dad3c325ffac09ff57 (cherry picked from commit fa5203c051fb5139c8fc678cae3997c8a7293c84)
* | am b7bd3488: Merge "Announce when formula has been completely deleted." into ↵Hans Boehm2015-10-112-8/+20
|\| | | | | | | | | | | | | mnc-dr-dev * commit 'b7bd34886fb39401b6e38ad97634655a0d025902': Announce when formula has been completely deleted.
| * Merge "Announce when formula has been completely deleted." into mnc-dr-devHans Boehm2015-10-112-8/+20
| |\
| | * Announce when formula has been completely deleted.Hans Boehm2015-10-092-8/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 23224425 Bug: 23695835 This adds a "cleared" announcement when last token/character is deleted. Also change the existing "clear" announcements to "cleared". Improve the comments for desc_clr and desc_del to address prior misunderstandings. Improve xml comment formatting consistency. Change-Id: Ibe5197ceac132b73d72f8ace3982238249f5e82b (cherry picked from commit db6f99979b713e491ace2f0cd9315e5c1616269b)
* | | am 3d4a67d1: Address FIXME comments from previous cleanup CLHans Boehm2015-10-113-57/+127
|\| | | | | | | | | | | | | | * commit '3d4a67d1ed392dd4788b84259d3d7ed7d694edf7': Address FIXME comments from previous cleanup CL
| * | Address FIXME comments from previous cleanup CLHans Boehm2015-10-103-57/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 24811759 Bug: 22047258 Add code to actively prevent ...99999 from getting turned back into ...00000 . This may have been imposssible anyway, but I couldn't prove it. Add tests for some Evaluator static functions, including the new unflipZeroes(). Fix a minor bug in exponentEnd() discovered in the process. The logic for limiting exponent length was wrong. Remove some no longer needed code to force a reevaluation. Generalize getPadding() function to repeat() and make it static. Remove leadingZeroes() which is no longer used. Make getMsdIndex() return the correct result even if it has changed due to reevaluation. Change-Id: Id457d8327ce0bc184d72ef78ddd3dbdaab7c6c78 (cherry picked from commit 7a432880b9d42b91a7069c6fb5398470f3cff19e)
* | | am a4eb1c07: Merge "Add docs directory and contents" into mnc-dr-devHans Boehm2015-10-102-0/+322
|\| | | | | | | | | | | | | | * commit 'a4eb1c0703c6bef81b4446f929111419f595cd3d': Add docs directory and contents
| * | Merge "Add docs directory and contents" into mnc-dr-devHans Boehm2015-10-102-0/+322
| |\ \
| | * | Add docs directory and contentsHans Boehm2015-10-092-0/+322
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 24811759 Add the following documentation files: arithmetic-overview.html describes the approach used to get "exact" arithmetic. implementation-overview.html outlines the major parts of the implementation. Change-Id: I3c8645aabbc5fb8aa894372a1eea0b5aad4a6473 (cherry picked from commit dd895bcaedc095c6dbb4d6df7cbc941e7a2a9d8d)
* | | am 114e08db: Merge "BoundedRational.java cleanup" into mnc-dr-devHans Boehm2015-10-102-129/+229
|\| | | | | | | | | | | | | | * commit '114e08db3c0ed3ffb77129ee5db62645edc580bb': BoundedRational.java cleanup
| * | Merge "BoundedRational.java cleanup" into mnc-dr-devHans Boehm2015-10-102-129/+229
| |\ \
| | * | BoundedRational.java cleanupHans Boehm2015-10-092-129/+229
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 24811759 Bug: 21469726 Bug: 23080519 Reformat to 100 columns. Reformat simple if-statements and rename variables for better consistency with coding conventions. Switch many comments to javadoc style. Consistently use signum() to compare to zero. It's more concise and probably slightly more efficient. Change the asBigInteger implementation to use a single divideAndRemainder call instead of relying on gcd. Add tests. Eliminate redundant test in maybeReduce(). Change-Id: I4c275494e076612d09a05bc317c9972008619cda (cherry picked from commit a4511f349124ca9cd2a7f9cb742be02b832a0206)
* | | am b13daf10: Evaluator.java and CalculatorExpr.java cleanupHans Boehm2015-10-104-819/+939
|\| | | | | | | | | | | | | | * commit 'b13daf1050757fe3c69c2f0246de33e7e69b5fa9': Evaluator.java and CalculatorExpr.java cleanup
| * | Evaluator.java and CalculatorExpr.java cleanupHans Boehm2015-10-094-819/+939
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 24811759 Bug: 21960281 Bug: 22047258 No substantive changes. Reformat to 100 columns. Correct and/or remove obsolete comments and occasional bits of clearly dead code. Better follow coding conventions. Rename variables for both internal consistency and consistency with other files. This included a few renamings in Calculator.java and CalculatorResult.java, and a comment fix in CalculatorResult.java. Rename public fields per coding convention. Correctly declare more nested classes static. Document FIXME issues to be addressed in followup CL. This includes a careful look at the msd computations. I cannot construct any failing examples, but I also cannot currently construct a correctness argument. Change-Id: I5c67493eeb7730edb4b3ca3ba1cb8b7d2b87dbc2 (cherry picked from commit abe2862bc936dd083b5ba19b68c68ea4cc44b2f6)
* | am 51fc9bdd: (-s ours) Import translations. DO NOT MERGEBaligh Uddin2015-09-180-0/+0
|\| | | | | | | | | * commit '51fc9bddf33616aa8abaf4a37889efa90679e445': Import translations. DO NOT MERGE
| * Import translations. DO NOT MERGEBaligh Uddin2015-09-185-6/+6
| | | | | | | | | | Change-Id: I3634105b46b3a4410a88c8041cecb8a77bfd8ff7 Auto-generated-cl: translation import
* | am 63bd424a: am 80018c88: Properly reserve display space for non-digitsHans Boehm2015-08-041-7/+21
|\| | | | | | | | | * commit '63bd424a237b2a30240a1695ad0359bd6a6f4c99': Properly reserve display space for non-digits
| * am 80018c88: Properly reserve display space for non-digitsHans Boehm2015-08-041-7/+21
| |\ | | | | | | | | | | | | * commit '80018c885a8f8c2ae32b05c4b2bcd7ae164b04fe': Properly reserve display space for non-digits
| | * Properly reserve display space for non-digitsHans Boehm2015-08-031-7/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 22882700 We did not correctly calculate the extra space we might need to add a decimal point to a scientific notation results. We also incorrectly assumed that minus signs are the same width as a digit. As a workaround we now reserve extra space for the possible non-digit characters to ensure that a result is never inadvertently truncated. Change-Id: I79b499121703cd51bbbf3e1d85b2285a2dd5e025
* | | am a629d7d2: (-s ours) am 9fd976e4: (-s ours) Import translations. DO NOT MERGEGeoff Mendal2015-07-280-0/+0
|\| | | | | | | | | | | | | | * commit 'a629d7d24abebe50b3aefba4072e29b06ed259e6': Import translations. DO NOT MERGE
| * | am 9fd976e4: (-s ours) Import translations. DO NOT MERGEGeoff Mendal2015-07-280-0/+0
| |\| | | | | | | | | | | | | * commit '9fd976e427c1c6d7242bb84787c01009e3261fdc': Import translations. DO NOT MERGE
| | * Import translations. DO NOT MERGEGeoff Mendal2015-07-282-3/+3
| | | | | | | | | | | | | | | Change-Id: I34d56cc0f6022088837820b7452ff84637355dad Auto-generated-cl: translation import
* | | am 84d6b6d2: (-s ours) Import translations. DO NOT MERGEGeoff Mendal2015-07-280-0/+0
|\| | | | | | | | | | | | | | * commit '84d6b6d289cb663c3efbfb4c1f305a3dae41f1d0': Import translations. DO NOT MERGE
| * | Import translations. DO NOT MERGEGeoff Mendal2015-07-284-5/+5
| | | | | | | | | | | | | | | Change-Id: I2cb5501fd2278919ccbc2d4168bf85ce99cc27d0 Auto-generated-cl: translation import
* | | am 51f5acc6: am 82e5a2f6: Avoid starting long uninterruptible computationsHans Boehm2015-07-242-14/+46
|\| | | | | | | | | | | | | | * commit '51f5acc6069b0ed9b4ee15132cc09e15b0307161': Avoid starting long uninterruptible computations
| * | am 82e5a2f6: Avoid starting long uninterruptible computationsHans Boehm2015-07-222-14/+46
| |\| | | | | | | | | | | | | * commit '82e5a2f60afd1cc330ccfa0b81b8824964e976c7': Avoid starting long uninterruptible computations
| | * Avoid starting long uninterruptible computationsHans Boehm2015-07-212-14/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 21957088 Shorten timeouts. We usually do short computations first, so this helps to avoid starting absurdly big ones. Check size of result before converting to decimal. If the decimal conversion is likely to time out anyway, just pretent we timed out. This turns out to avoid a lot of problems, since BigInteger decimal conversion is the clear bottleneck for something like 100000! And its uninterruptible. Remove the timeout in one case in which we had previously forgotten. Check for interrupts in a couple of more places in BoundedRational. One of these caused log(10^100000) to hang for a long time. One or two trivial cleanups in code that was touched anyway. Change-Id: I3494a8ed28f681fb26634ecd90042e2f2a8008a8
* | | am 9d75c1ac: am 8a4f81c5: More correctly pronounce advanced operators in ↵Hans Boehm2015-07-214-30/+112
|\| | | | | | | | | | | | | | | | | | | | Talkback * commit '9d75c1ac50abcd44ab5870a56e112196dc8c87c1': More correctly pronounce advanced operators in Talkback
| * | am 8a4f81c5: More correctly pronounce advanced operators in TalkbackHans Boehm2015-07-214-30/+112
| |\| | | | | | | | | | | | | * commit '8a4f81c5b30edd4e62d222a17f4e0e2140bfd99d': More correctly pronounce advanced operators in Talkback
| | * More correctly pronounce advanced operators in TalkbackHans Boehm2015-07-204-30/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 19190211 Bug: 19202945 Bug: 21052751 Bug: 19165054 Bug: 22594908 Add TtsSpans for operators that are otherwise misread by TalkBack. Force correct reading for some individual characters. This greatly improves Talkback for advanced operators in Calculator. This is imperfect. There is no guarantee that the strings I'm using will work in all languages. But they're almost certainly better than what we have now. And it makes parentheses and factorial usable, though perhaps a bit verbose. We also no longer pronounce "sine" as "sin". Removed some now obsolete TODO comments. Change-Id: I5236f682be828699e08dca04ee6fa073269964f6
* | | am d28d46e3: (-s ours) am 22c0a189: (-s ours) Import translations. DO NOT MERGEGeoff Mendal2015-07-150-0/+0
|\| | | | | | | | | | | | | | * commit 'd28d46e33c3303b9723c5cab7cfd0d198db01579': Import translations. DO NOT MERGE
| * | am 22c0a189: (-s ours) Import translations. DO NOT MERGEGeoff Mendal2015-07-150-0/+0
| |\| | | | | | | | | | | | | * commit '22c0a189febb3ee2d0149f6babc3a84e25e3594d': Import translations. DO NOT MERGE
| | * Import translations. DO NOT MERGEGeoff Mendal2015-07-153-3/+3
| | | | | | | | | | | | | | | Change-Id: Ie444e4259eb75707b8549ee4e62f25844f897736 Auto-generated-cl: translation import
* | | am b9762f77: am ae807e1d: Force reevaluation if mChangedValue is trueHans Boehm2015-07-141-8/+15
|\| | | | | | | | | | | | | | * commit 'b9762f77255c4980d364165bc95e7bf05f82b4c6': Force reevaluation if mChangedValue is true
| * | am ae807e1d: Force reevaluation if mChangedValue is trueHans Boehm2015-07-141-8/+15
| |\| | | | | | | | | | | | | * commit 'ae807e1d4d5764d74fcbc44556945ff345c27157': Force reevaluation if mChangedValue is true
| | * Force reevaluation if mChangedValue is trueHans Boehm2015-07-141-8/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 22481292 This could result in display of an old result. Factor out code to start a result evaluation. Change-Id: I651d4386323c0abd7a86176b386072093345a1b1
* | | am 3c46e939: (-s ours) Import translations. DO NOT MERGEGeoff Mendal2015-07-130-0/+0
|\| | | | | | | | | | | | | | * commit '3c46e93981e5e056df30cd7ab286b3cc0c5644b4': Import translations. DO NOT MERGE
| * | Import translations. DO NOT MERGEGeoff Mendal2015-07-1112-22/+22
| | | | | | | | | | | | | | | Change-Id: Ic4484a9655f7ace9bf03b310b6ee97ac5819c185 Auto-generated-cl: translation import