Skip to content

vpetrigo/RationalNum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Rational number implementation.

There are implemented several operators like +,-,/,*, so now you can use it like that:

  Rational A(1, 2);
  Rational B(3, 5);
  
  Rational C = A + B; 
  //it will produce the result of 11/10

Also, there are the overloaded operators for comparison rational numbers. You are able to use all kind of operators like ==, >, <, >=, <=, != if you want.

There are also implemented printing function and come kind of inversion function which may be helpful if you want invert rational number. For example:

    Rational A(1,2);
    A.print_result();
    //1/2
    A.inv();
    A.print_result();
    //2

About

Rational Number implementation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages