That's about the size I thought that continued fraction method would be. I was thinking the repeated decimal string method might take less code, but once all the variations are handled, it probably...
Type: Posts; User: rcgldr
That's about the size I thought that continued fraction method would be. I was thinking the repeated decimal string method might take less code, but once all the variations are handled, it probably...
You'll also need to check for fractions that are exact decimal values, such as .1520000000. For these, you'll need to multiply by 10, then subtract the integer part to see if the fractional part is...
You need to find the length of the repeating pattern and set n = length of repeating pattern. Then multiply the number by 10^n, then subtract that number from 10^n times the number. The result will...