Decimal expansion to exact fraction converter
Describe the decimal using a signed whole part, a finite prefix and an optional repeating block. The converter preserves the declared digits exactly.
Result
- Numerator
- 3
- Denominator
- 11
- Exact fraction
- 3/11
Separate the two fractional blocks
Whole part 0, an empty prefix and repeating block 27 represent 0.272727… and reduce to 3/11. Whole part 1 with prefix 375 and no repeat gives 11/8. A whole part of -0, prefix 1 and repeat 6 represents negative 0.166666… and reduces to -1/6.
How the exact fraction is formed
A finite prefix of m digits supplies a factor of 10^m in the denominator. A repeating block of r digits adds a factor of 10^r − 1. The numerator combines the whole magnitude and both blocks before reduction by their greatest common divisor. A leading minus applies to the entire expansion. Each fractional block accepts up to 100 digits; the whole part accepts up to 100 digits plus a minus sign.