1. 14 Oct, 2015 1 commit
  2. 13 Oct, 2015 1 commit
    • Hans Boehm's avatar
      Correctly set formula text size after rotation · 9bc3f44b
      Hans Boehm authored
      Bug: 22233200
      
      Avoid repeatedly resetting text size to maximum, due to repeated
      onMeasure calls.
      
      Suppress text size change animation when the application is restarted.
      
      Change-Id: Ic8b20deab2553176260051fa787416654bf0b3ef
      9bc3f44b
  3. 12 Oct, 2015 1 commit
  4. 11 Oct, 2015 10 commits
  5. 10 Oct, 2015 3 commits
    • Hans Boehm's avatar
      Address FIXME comments from previous cleanup CL · 3d4a67d1
      Hans Boehm authored
      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 7a432880)
      3d4a67d1
    • Hans Boehm's avatar
      a4eb1c07
    • Hans Boehm's avatar
      114e08db
  6. 09 Oct, 2015 5 commits
    • Hans Boehm's avatar
      Announce when formula has been completely deleted. · 4d63cfce
      Hans Boehm authored
      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 db6f9997)
      4d63cfce
    • Hans Boehm's avatar
      Fix factorial(0) · 9ad6f6d9
      Hans Boehm authored
      Bug: 24575798
      
      Make factorial(0) return 1, as intended.
      Add a few factorial tests.
      Fix targetPackage spec so test is actually runnable again.
      
      Change-Id: Ibb8d827f0325999c6b5ed49a939e1532ddf55639
      (cherry picked from commit 69515918)
      9ad6f6d9
    • Hans Boehm's avatar
      Add docs directory and contents · 41718121
      Hans Boehm authored
      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 dd895bca)
      41718121
    • Hans Boehm's avatar
      BoundedRational.java cleanup · fc8a8d3e
      Hans Boehm authored
      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 a4511f34)
      fc8a8d3e
    • Hans Boehm's avatar
      Evaluator.java and CalculatorExpr.java cleanup · b13daf10
      Hans Boehm authored
      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 abe2862b)
      b13daf10
  7. 18 Sep, 2015 1 commit
  8. 04 Aug, 2015 1 commit
  9. 03 Aug, 2015 1 commit
    • Hans Boehm's avatar
      Properly reserve display space for non-digits · 80018c88
      Hans Boehm authored
      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
      80018c88
  10. 28 Jul, 2015 3 commits
  11. 22 Jul, 2015 1 commit
  12. 21 Jul, 2015 2 commits
    • Hans Boehm's avatar
      Avoid starting long uninterruptible computations · 82e5a2f6
      Hans Boehm authored
      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
      82e5a2f6
    • Hans Boehm's avatar
      am 8a4f81c5: More correctly pronounce advanced operators in Talkback · 9d75c1ac
      Hans Boehm authored
      * commit '8a4f81c5':
        More correctly pronounce advanced operators in Talkback
      9d75c1ac
  13. 20 Jul, 2015 1 commit
    • Hans Boehm's avatar
      More correctly pronounce advanced operators in Talkback · 8a4f81c5
      Hans Boehm authored
      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
      8a4f81c5
  14. 15 Jul, 2015 2 commits
  15. 14 Jul, 2015 2 commits
  16. 11 Jul, 2015 1 commit
  17. 09 Jul, 2015 2 commits
    • Hans Boehm's avatar
      am 0b9806f6: Support pasting of scientific notation numbers · 8f4a8c73
      Hans Boehm authored
      * commit '0b9806f6':
        Support pasting of scientific notation numbers
      8f4a8c73
    • Hans Boehm's avatar
      Support pasting of scientific notation numbers · 0b9806f6
      Hans Boehm authored
      Bug: 21470972
      
      Support pasting of numbers using scientific notation with 'E'.  This
      is intentionally very restricted to dodge ambiguities with the
      constant e.  We only accept a scientific notation constant if it is
      
      1) Contained within a single pasted text element.
      2) Uses capital 'E' to introduce the exponent.
      3) Does not contain an explicit '+' in the exponent.
      
      We do currently use the same notion of 'digit' as elsewhere, i.e.
      Character.isDigit(), which might be too general.
      
      For consistency, and to make sure that we can recognize machine
      generated output, this also adds a few more aliases for text input
      of arithmetic operators.
      
      For consistency, always use 'E' internally for scientific notation as
      well.
      
      We ensure that a pasted numeric string is not concatenated with
      a pre-existing constant.  This is a judgment call, but it means
      that pasting a previous calculator result gets similar treatment
      whether or not we are still running the same calculator instance.
      
      We support limited editing on exponents.  Once an exponent is deleted,
      the only way to restore it is via pasting.  The 10^x button
      produces similar results, though with different operator precedence
      behavior.
      
      Change-Id: I2d0f3dceb641cdad327fd3c3540b5eea38030146
      0b9806f6
  18. 08 Jul, 2015 2 commits