Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 682ff5e8 authored by Hans Boehm's avatar Hans Boehm
Browse files

Add BoundedRational evaluation

We would like to display finite representations of calculator results
when they clearly exist and are easy to identify, such as when adding
currency values.  We do this by computing a rational representation
of the result when it exists, and using that to compute the number
of digits in a finite representation.

Since rational arithmetic can become very expensive, we bound the
size of the results we are willing to keep.  If things get too large
we fall back on the standard constructive real arithmetic.  Finite
representations are extremely unlikely in such cases anyway.  This
also gives us a clear rule for when to normalize fractions, which
is often a challenge with rational number packages.

This also adds a couple of routines to set degree mode, but does
not include the UI to actually invoke them.  Thus there is still
no way to test some important pieces of functionality.

Change-Id: I3c1aca5aefd8d8c19bce79095bde59ee3b4127fe
parent 5af2ce8f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment