An open API service indexing awesome lists of open source software.

https://github.com/kostad02/rational-number-class

Class of rational number
https://github.com/kostad02/rational-number-class

class number-denominator number-numerator object-oriented-programming rational-numbers rationalnumber

Last synced: 1 day ago
JSON representation

Class of rational number

Awesome Lists containing this project

README

          

# Rational Number Class

Simple rational class with operators.

In this code u can you class aswell operators.

Also you can change double number to rational number.

Input first number numerator = 4

Input first number denominator = 2

Input second number numerator = 1

Input second number denominator = 3

First number is 2

Second number is 1/3

Some calculations :

2/1 + 1/3 = 7/3

2/1 - 1/3 = 5/3

2/1 \* 1/3 = 2/3

2/1 / 1/3 = 6/1

Now compate numbers:

Is 2 bigger than 1/3 ? Yes

Is 2 less than 1/3 ? No

is 2 equal to 1/3 ? No

Changing double to rational number :

Inputed number : 78.145

Rational number : 15629/200

Inputed number : 25.175

Rational number : 1007/40

Inputed number : 256.17

Rational number : 25617/100

# Made by : Konstantine Datunishvili