Wow. That one lukewarm expression of achievement was all it took to get you to read the rest of this post? Well... all right, then.
What it was that was what I got was that I figured out how to make the Fractionizer more useful.
As you may recall, I was in a bit of a quandary. Because the purpose of the script was to approximate fractions from decimals, it gave the misleading impression of accuracy in cases where it was not only not accurate, but literally could not be made perfectly accurate (as in the recurring1 problem of digits after the decimal point that go on forever, such as $0.\bar{3}$ or $2.\overline{456}$).
I spent a fair amount of time trying to find a way to get around this, when it finally occurred to me I should just present two answers. One would be a literal fraction, assuming the digits terminate exactly where they do without repeating. The other would be the approximation.
So here it is. New and improved! I used MathJax to render the fractions for nicer niceness. Oh, and I've separated (distilled out, if you will) the fractions that appear to contain pi, and added support for the number e, too.
Literal fraction
Approximation
Fraction in terms of π
Fraction in terms of e
1 A significant and nontrivial fraction of my recurring dreams involve factors I assume are derived from experiences integral to my roots, and it is hard to differentiate sometimes between the real or natural world and the transcendental, irrational though that may sound.
No comments:
Post a Comment