Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
packages_apps_ExactCalculator
Commits
6e8087f4
Commit
6e8087f4
authored
9 years ago
by
Hans Boehm
Committed by
Android (Google) Code Review
9 years ago
Browse files
Options
Download
Plain Diff
Merge "Correct off-by-1 errors in display formatting code." into mnc-dev
parents
8b1efdb8
5e802f30
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
151 additions
and
133 deletions
+151
-133
src/com/android/calculator2/CalculatorResult.java
src/com/android/calculator2/CalculatorResult.java
+129
-133
tests/README.txt
tests/README.txt
+22
-0
No files found.
src/com/android/calculator2/CalculatorResult.java
View file @
6e8087f4
This diff is collapsed.
Click to expand it.
tests/README.txt
View file @
6e8087f4
...
...
@@ -19,3 +19,25 @@ is used by the calculator mostly to identify exact results, i.e.
terminating decimal expansions. But it's also used to optimize CR
computations, and bugs in BoundedRational could result in incorrect
outputs.)
We currently have no automatic tests for display formatting corner cases.
The following numbers have exhibited problems in the past and would be good
to test. Some of them are difficult to test automatically, because they
require scrolling to both ends of the result. For those with finite
decimal expansions, it also worth confirming that the "display with leading
digits" display shows an exact value when scrolled all the way to the right.
Some interesting test cases:
10^10 + 10^30
10^30 + 10^-10
-10^30 + 20
10^30 + 10^-30
-10^30 - 10^10
-1.2x10^-9
-1.2x10^-8
1 - 10^-98
1 - 10^-100
1 - 10^-300
1/-56x10^18 (on a Nexus 7 sized portrait display)
-10^-500 (scroll to see the 1, then scroll back & verify minus sign appears)
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment