Finds the fraction closest to a decimal, keeping the denominator within the limit you set. A decimal such as 0.375 comes out exactly as 3/8, while a number such as pi gives the nearest approximation. The difference from the original decimal is also shown.
The fraction closest to a decimal is found, keeping the denominator within a limit you set. A decimal that terminates comes out exactly, with a difference of 0. A number such as pi, which no fraction represents exactly, gives the nearest one the limit allows.
is the decimal, the largest denominator allowed and the answer. It comes back in lowest terms, with the mixed number and the difference from the original decimal.
Converting 0.375 with a limit of 1000, reduces to , and the difference is 0. Since it is exact, lowering the limit to 10 gives the same answer.
Converting pi with a limit of 1000 gives . The difference is about 0.0000003, so the two agree to six decimal places.
A larger limit finds a closer fraction, but the denominator grows with it and the answer gets harder to use. A fraction such as , which fits well with a small denominator, holds its place over a wide range of limits.
A repeating decimal written out part way, such as 0.3333333333, still returns at a limit of 1000.
The limit must be a whole number of at least 1, and no more than 100000.
The sign of the difference says which side the fraction falls on. A negative difference means the fraction is the larger of the two.