Post Reply 
Arbitrary precision - two or three approaches
06-03-2022, 06:27 AM
Post: #1
Arbitrary precision - two or three approaches
Most calculators, and even most calculator apps, have some specific precision, often a number of decimal digits, and typically they will have a few extra digits to hide most rounding errors...

... but it's possible to do better, to offer precision limited only by memory, at the cost of some performance, and some extra effort.

This video discusses an app for Android which allows scrolling to keep fetching up more digits:
Google's ingenious variable-precision Calculator app

From the description:
Quote:This video is about an under-appreciated feature of Google's standard Calculator app on Android.

The Google Calculator supports an exact arithmetic variable-precision engine that always displays full and correct results. The user can swipe results to see digits that are always accurate and never rounded.

This arithmetic engine was created by Hans-J. Boehm:
- https://hboehm.info/

There is an high level article in Communications of the ACM about how the arithmetic engine was implemented:
- Small-Data Computing: Correct Calculator Arithmetic
by Hans-J. Boehm

There is also a detailed technical paper about it here:
- Towards an API for the Real Numbers, Hans-J. Boehm, 15 pages)

I think I'm right in saying Boehm describes two different approaches in those two articles: the more detailed paper is from 2020.

As another offering, Simon Tatham has written a command line calculator, like the venerable bc, but offering arbitrary precision by use of spigot algorithms:
spigot : an exact real calculator
(It's open source.)

For interest, see particularly Chapter 5: Hazards to computation.

It might be that the microcontrollers used, for example, by Swiss Micros could support something like these approaches - as much precision as memory allows, with some interface which allows the user to get a useful result quickly and more digits on demand.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Arbitrary precision - two or three approaches - EdS2 - 06-03-2022 06:27 AM



User(s) browsing this thread: 1 Guest(s)