Skip to content

Commit 2ddecc6

Browse files
bugfix in Rational.cs
1 parent 7d0bbbd commit 2ddecc6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/ImageSharp/Primitives/Rational.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ public Rational(double value, bool bestPrecision)
7474

7575
this.Numerator = (uint)rational.Numerator;
7676
this.Denominator = (uint)rational.Denominator;
77+
78+
if(this.Numerator == 0 && this.Denominator == 0)
79+
{
80+
this.Denominator = 1;
81+
}
7782
}
7883

7984
/// <summary>

0 commit comments

Comments
 (0)