Skip to content

Commit e17df84

Browse files
ViorelViorel
authored andcommitted
Fix period formatting.
1 parent 313529d commit e17df84

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

RationalApproximationLibrary/FractionFormatter.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ public static string ToFloatString( ICancellable cnc, Fraction f, int maxDigits,
174174
return sb.ToString( );
175175
}
176176

177-
178177
static void FormatFloatingPoint( ICancellable cnc, StringBuilder sb, BigInteger n, BigInteger d, BigInteger e, int maxDigits, bool group = false )
179178
{
180179
// Simplification using GCD is not done here;
@@ -275,7 +274,7 @@ static void FormatFloatingPoint( ICancellable cnc, StringBuilder sb, BigInteger
275274
for( int i = 0; r != 0 && i < allowed_space; ++i )
276275
{
277276
cnc.TryThrow( );
278-
remainders.Add( r, 0 );
277+
remainders.Add( r, i );
279278

280279
(BigInteger qf, r) = BigInteger.DivRem( r * Bi10, d );
281280

0 commit comments

Comments
 (0)