Skip to content

Commit

Permalink
OOP bug fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
yonimn2000 committed Sep 24, 2019
1 parent 35a1d68 commit c37b2c8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Fractions/Math.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public Fraction Reciprocate()

public Fraction GetReciprocal()
{
return new Fraction(Reciprocate());
return new Fraction(this).Reciprocate();
}

public Fraction Exponenciate(decimal exponent)
Expand Down
2 changes: 1 addition & 1 deletion Fractions/Operators.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static public explicit operator decimal(Fraction fraction)

static public explicit operator long(Fraction fraction)
{
return (long)fraction.Simplify().GetWhole();
return (long)new Fraction(fraction).Simplify().GetWhole();
}

static public bool operator <(Fraction fraction1, Fraction fraction2)
Expand Down

0 comments on commit c37b2c8

Please sign in to comment.