08-04-2022, 10:30 AM
(08-03-2022, 05:39 PM)Pete Wrote: @Stuart
Great post! Woohoo, my routine was able to identify .000000000000001184237892933500309785207112630208333333 as an eventual infinite repetend of 3s.
.000000000000001184237892933500309785207112630208333333
So for fun, let's turn that decimal into a fraction...
To be honest, at first I started getting a little lost at this point... but I eventually got it.
I'm glad you found the info interesting and useful.
Quote:So next up is a way to convert decimals to fractions. This is a test but if it works in all cases, it would be easy to set it up as a conversion calculator. Of course for now, I've left out the string math, so it is limited to around a dozen digits before VAL() craps out. That won't be a problem once it is plugged into the string math routine, later...
This works unless there are "unique digits" before the repetend begins.
Here's some info I found about converting repeating decimals to fractions even when there are "unique digits" :
https://www.basic-mathematics.com/conver...tions.html
(See Example #2)