Base converter with fractions?

01262017, 05:18 PM
(This post was last modified: 01262017 05:18 PM by Joe Horn.)
Post: #5




RE: Base converter with fractions?
(01262017 12:38 PM)Jan_D Wrote: When I would like to express 3.142 in base 7, I would do the following. Unfortunately that amount of initial roundoff introduces a great amount of error. Smith's BASECALC converts 3.142 (decimal) to "3.06646410512335" (base 7), which it converts cleanly back to what we started with, namely 3.142 (decimal), whereas "3.0665" (base 7) converts to 3.1420241566 (decimal), which is not what we started with. Multiplying by a greater power of 7 at the beginning helps achieve greater accuracy, but even using 7^13 (which turns 3.142 into an integer in a 12digit machine) doesn't yield a result as accurate as BASECALC's. I guess it's time to explore Smith's method. It might be objected that the input only had four significant digits, so the output should be rounded off accordingly. But that's not necessarily true; a user might intend that input to mean "exactly 3.142", as if they had input 3.14200000000 with the trailing zeros being significant digits. HP's philosophy has never been to round outputs to the number of significant digits of the input, because only the user knows the input's number of significant digits. HP's philosophy has always been, "Assume that the user's input is exactly what they want it to be, and let them adjust the accuracy of the result if they want to." IMHO all HP calculator software should follow that philosophy. <0ΙΈ0> Joe 

« Next Oldest  Next Newest »

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