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
- Host: GitHub
- URL: https://github.com/kostad02/rational-number-class
- Owner: KostaD02
- Created: 2021-05-01T12:29:55.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-05-02T15:17:29.000Z (about 5 years ago)
- Last Synced: 2025-02-28T22:52:08.839Z (over 1 year ago)
- Topics: class, number-denominator, number-numerator, object-oriented-programming, rational-numbers, rationalnumber
- Language: C++
- Homepage:
- Size: 131 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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