Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Class to Represent Rational Numbers with Operators Overload

Overload the Arithmetic Operators for Rational Numbers

Overloads the following operators:

  • -Rational
  • Rational + Rational
  • Rational - Rational
  • Rational * Rational
  • Rational / Rational
  • Rational += Rational
  • Rational -= Rational
  • Rational *= Rational
  • Rational /= Rational
  • Rational = Rational
  • Rational == Rational
  • Rational != Rational
  • Rational > Rational
  • Rational >= Rational
  • Rational <= Rational
  • Rational < Rational

The class has the following data members:

int _numerator, _denominator;

And the following constructors:

Rational(int numerator, int denominator);
Rational(double number); // If you don't implement it set _numerator to 0 and _denominator to 1

:D

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages