<feed xmlns='http://www.w3.org/2005/Atom'>
<title>android_packages_apps_ExactCalculator/tests, branch stable/cm-13.0-ZNH2KB</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.replicant.us/mirrors/LineageOS/android_packages_apps_ExactCalculator/'/>
<entry>
<title>Merge "Fix factorial(0)" into mnc-dr-dev</title>
<updated>2015-10-11T16:43:16+00:00</updated>
<author>
<name>Hans Boehm</name>
<email>hboehm@google.com</email>
</author>
<published>2015-10-11T16:43:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/mirrors/LineageOS/android_packages_apps_ExactCalculator/commit/?id=6cccee27f07ad3cf8ba5d221afd8bfd4a867b573'/>
<id>6cccee27f07ad3cf8ba5d221afd8bfd4a867b573</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Check for decimal point after adding ellipsis</title>
<updated>2015-10-11T06:29:29+00:00</updated>
<author>
<name>Hans Boehm</name>
<email>hboehm@google.com</email>
</author>
<published>2015-09-03T23:04:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/mirrors/LineageOS/android_packages_apps_ExactCalculator/commit/?id=ec7517f38758f67233f2b06bc7bab17a8ffeccba'/>
<id>ec7517f38758f67233f2b06bc7bab17a8ffeccba</id>
<content type='text'>
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)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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)
</pre>
</div>
</content>
</entry>
<entry>
<title>Address FIXME comments from previous cleanup CL</title>
<updated>2015-10-10T00:12:07+00:00</updated>
<author>
<name>Hans Boehm</name>
<email>hboehm@google.com</email>
</author>
<published>2015-08-06T00:20:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/mirrors/LineageOS/android_packages_apps_ExactCalculator/commit/?id=3d4a67d1ed392dd4788b84259d3d7ed7d694edf7'/>
<id>3d4a67d1ed392dd4788b84259d3d7ed7d694edf7</id>
<content type='text'>
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)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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)
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix factorial(0)</title>
<updated>2015-10-09T23:14:11+00:00</updated>
<author>
<name>Hans Boehm</name>
<email>hboehm@google.com</email>
</author>
<published>2015-10-01T23:07:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/mirrors/LineageOS/android_packages_apps_ExactCalculator/commit/?id=9ad6f6d99c895cb32de602b9f731f4cb730066a6'/>
<id>9ad6f6d99c895cb32de602b9f731f4cb730066a6</id>
<content type='text'>
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 6951591806f46405564a6cb868a88d0daf6764d2)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 6951591806f46405564a6cb868a88d0daf6764d2)
</pre>
</div>
</content>
</entry>
<entry>
<title>BoundedRational.java cleanup</title>
<updated>2015-10-09T21:27:09+00:00</updated>
<author>
<name>Hans Boehm</name>
<email>hboehm@google.com</email>
</author>
<published>2015-08-10T23:19:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/mirrors/LineageOS/android_packages_apps_ExactCalculator/commit/?id=fc8a8d3e6273356ba795f647b38fc01f68727c1c'/>
<id>fc8a8d3e6273356ba795f647b38fc01f68727c1c</id>
<content type='text'>
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)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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)
</pre>
</div>
</content>
</entry>
<entry>
<title>Correct off-by-1 errors in display formatting code.</title>
<updated>2015-06-23T22:12:12+00:00</updated>
<author>
<name>Hans Boehm</name>
<email>hboehm@google.com</email>
</author>
<published>2015-06-23T00:18:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/mirrors/LineageOS/android_packages_apps_ExactCalculator/commit/?id=5e802f30a0f18df4e2ecbf030e4aebb4ee70e8e8'/>
<id>5e802f30a0f18df4e2ecbf030e4aebb4ee70e8e8</id>
<content type='text'>
Bug: 21986868
Bug: 21960281

Fix and restructure the formatting and scroll-limit-calculation
code.  This code is inherently tricky, and has had more bugs than
we would like to admit to.  Use the opportunity to clean up the
code a bit, renaming variables consistently.

The good news is that the code seems to be getting slightly
simpler with each bug fix.

This fixes several separate off-by-one errors related to result
formatting:

The expLen() exponent string length calculation was off by 1
for exact powers of 10.

The dropDigits calculation in the formatting code was off for
negative exponents just shorter than an exact power of 10.

The exponent space calculation for a few results like -1.2*10^-8
was off by one.

For a result like -10^-500 we did not reserve space for the leading
minus sign, since that's not computed until after scrolling.

[Less serious] The ellipses were omitted when we had just barely
scrolled a leading minus sign off the screen.  (This only occurred
in exactly one position, which could never be the default one.)

Change-Id: If1bfbbb70a624998be3d996592d129b16aade745
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Bug: 21986868
Bug: 21960281

Fix and restructure the formatting and scroll-limit-calculation
code.  This code is inherently tricky, and has had more bugs than
we would like to admit to.  Use the opportunity to clean up the
code a bit, renaming variables consistently.

The good news is that the code seems to be getting slightly
simpler with each bug fix.

This fixes several separate off-by-one errors related to result
formatting:

The expLen() exponent string length calculation was off by 1
for exact powers of 10.

The dropDigits calculation in the formatting code was off for
negative exponents just shorter than an exact power of 10.

The exponent space calculation for a few results like -1.2*10^-8
was off by one.

For a result like -10^-500 we did not reserve space for the leading
minus sign, since that's not computed until after scrolling.

[Less serious] The ellipses were omitted when we had just barely
scrolled a leading minus sign off the screen.  (This only occurred
in exactly one position, which could never be the default one.)

Change-Id: If1bfbbb70a624998be3d996592d129b16aade745
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix digitsRequired() for negative denominators</title>
<updated>2015-06-14T04:12:23+00:00</updated>
<author>
<name>Hans Boehm</name>
<email>hboehm@google.com</email>
</author>
<published>2015-06-14T04:12:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/mirrors/LineageOS/android_packages_apps_ExactCalculator/commit/?id=cd740596f6f8bdacf02f735f116ffc544f922893'/>
<id>cd740596f6f8bdacf02f735f116ffc544f922893</id>
<content type='text'>
Bug: 21789679

Also adds some tests for digitsRequired(), including one that fails
without this CL.

Change-Id: Ib007e753f90c019c37666d71c1cfd02301dcd360
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Bug: 21789679

Also adds some tests for digitsRequired(), including one that fails
without this CL.

Change-Id: Ib007e753f90c019c37666d71c1cfd02301dcd360
</pre>
</div>
</content>
</entry>
<entry>
<title>Implement percent and new inverse functions</title>
<updated>2015-06-02T18:51:09+00:00</updated>
<author>
<name>Hans Boehm</name>
<email>hboehm@google.com</email>
</author>
<published>2015-05-31T19:19:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/mirrors/LineageOS/android_packages_apps_ExactCalculator/commit/?id=4db31b490443e4454d98a5ae2bc44b87149accfe'/>
<id>4db31b490443e4454d98a5ae2bc44b87149accfe</id>
<content type='text'>
Bug: 21493470

Add x^2 10^x and e^x functions, to make the recently added INV key
work as expected.

Implement % functionality.

10^x is essentially just macro expansions for now.

% and x^2 need trivial evaluator support to provide reasonable display
syntax.

We decided to add evaluator support for exp() as well.

Add corresponding exp() support to BoundedRational and its tests.

Tiny incidental changes for problems uncovered in the process:
Fix bug in tests/README.txt
Evaluate the constant e only once.
Add one more power test along with the exp() test.
Fix proguard.flags so BRTest runs again.

Change-Id: I26cfcaf6d99aeec11387297cc5586e2ddcab6add
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Bug: 21493470

Add x^2 10^x and e^x functions, to make the recently added INV key
work as expected.

Implement % functionality.

10^x is essentially just macro expansions for now.

% and x^2 need trivial evaluator support to provide reasonable display
syntax.

We decided to add evaluator support for exp() as well.

Add corresponding exp() support to BoundedRational and its tests.

Tiny incidental changes for problems uncovered in the process:
Fix bug in tests/README.txt
Evaluate the constant e only once.
Add one more power test along with the exp() test.
Fix proguard.flags so BRTest runs again.

Change-Id: I26cfcaf6d99aeec11387297cc5586e2ddcab6add
</pre>
</div>
</content>
</entry>
<entry>
<title>Prepare ExactCalculator for master fishfood</title>
<updated>2015-04-16T22:11:42+00:00</updated>
<author>
<name>Justin Klaassen</name>
<email>justinklaassen@google.com</email>
</author>
<published>2015-04-16T22:05:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/mirrors/LineageOS/android_packages_apps_ExactCalculator/commit/?id=01db51b36603f5349c7a372715d22b8352ea9e8d'/>
<id>01db51b36603f5349c7a372715d22b8352ea9e8d</id>
<content type='text'>
- Switched back to using com.android.calculator2 package name.
- Setup to replace Calculator package.
- Replaced launcher icon with fishfood variant.

Change-Id: Ie3a74249e4d1808c50bfd86a3030e0ae61165c67
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Switched back to using com.android.calculator2 package name.
- Setup to replace Calculator package.
- Replaced launcher icon with fishfood variant.

Change-Id: Ie3a74249e4d1808c50bfd86a3030e0ae61165c67
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix UI holes and bugs. Fix eval bugs.</title>
<updated>2015-04-16T00:56:33+00:00</updated>
<author>
<name>Hans Boehm</name>
<email>hboehm@google.com</email>
</author>
<published>2015-04-04T01:41:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/mirrors/LineageOS/android_packages_apps_ExactCalculator/commit/?id=4a6b7cb235c305761af5d7f40e74d4704e5058c8'/>
<id>4a6b7cb235c305761af5d7f40e74d4704e5058c8</id>
<content type='text'>
Change layout to make the result display use a fixed font
size and limit the number of characters when it appears below the
formula.  This allows us to always get the proper expansion effect
and prevents scrolling from affecting the font size.

Add copy support for result display.

Add paste support for the formula.

Add keyboard input support.

Copy/paste can be used to remember old results in the calculator.
We save an identifying tag URI in the clip, in addition to text,
allowing us to paste old calculator results without precision
loss.

Copy/paste currently does not rely on selection at all.
I had trouble making it work that way in the formula.  It's
unclear that would be better, since we only allow copy of the
entire text and paste at the end.

Add a couple of alternate result display options to the
overflow menu.  (These appear quite useful, were trivial to
implement, and give us a better excuse for the overflow menu.)

Changed the behavior of the delete key in error state.
Changing it to CLEAR seemed unfriendly, since it prevents
corrections.  This is a change from L.

Made it clear that the CalculatorHitSomeButtons test is
currently 95% worthless.  It was apparentlly failing (due to test
infrastructure issues) but throwing an exception in a thread from
which it was not getting reported.  Decided to keep it, since I
would like a place to continue collecting regression tests, even
if we can't actually run them yet.

Includes some easy drive-by fixes for expression evaluation:

a) 2 / 2 * 3 was mis-parsed as 2 / (2 * 3).

b) Cosine evaluation had the sense of the test for a rational result reversed.

c) Constants without leading digits, like .1, are now handled correctly,
and decimal points in the formula are now internationalized.
(That's not yet true for the result.)

Change-Id: Ic24466b444b4a4633cfb036c67622c7f4fd644ec
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change layout to make the result display use a fixed font
size and limit the number of characters when it appears below the
formula.  This allows us to always get the proper expansion effect
and prevents scrolling from affecting the font size.

Add copy support for result display.

Add paste support for the formula.

Add keyboard input support.

Copy/paste can be used to remember old results in the calculator.
We save an identifying tag URI in the clip, in addition to text,
allowing us to paste old calculator results without precision
loss.

Copy/paste currently does not rely on selection at all.
I had trouble making it work that way in the formula.  It's
unclear that would be better, since we only allow copy of the
entire text and paste at the end.

Add a couple of alternate result display options to the
overflow menu.  (These appear quite useful, were trivial to
implement, and give us a better excuse for the overflow menu.)

Changed the behavior of the delete key in error state.
Changing it to CLEAR seemed unfriendly, since it prevents
corrections.  This is a change from L.

Made it clear that the CalculatorHitSomeButtons test is
currently 95% worthless.  It was apparentlly failing (due to test
infrastructure issues) but throwing an exception in a thread from
which it was not getting reported.  Decided to keep it, since I
would like a place to continue collecting regression tests, even
if we can't actually run them yet.

Includes some easy drive-by fixes for expression evaluation:

a) 2 / 2 * 3 was mis-parsed as 2 / (2 * 3).

b) Cosine evaluation had the sense of the test for a rational result reversed.

c) Constants without leading digits, like .1, are now handled correctly,
and decimal points in the formula are now internationalized.
(That's not yet true for the result.)

Change-Id: Ic24466b444b4a4633cfb036c67622c7f4fd644ec
</pre>
</div>
</content>
</entry>
</feed>
