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
Loading
Please register or sign in to comment