-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFraction.h
More file actions
49 lines (37 loc) · 1.1 KB
/
Fraction.h
File metadata and controls
49 lines (37 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//
// Created by nikstarling on 3/4/20.
//
#ifndef PARSER_FRACTION_H
#define PARSER_FRACTION_H
#include <cmath>
#include <iostream>
#include "LinkedList.h"
#include "Sieve_of_eratosthenes.h"
class Fraction {
private:
long long numerator;
long long denominator;
static Sieve_of_eratosthenes prime_numbers;
public:
Fraction();
Fraction(int number);
Fraction(int numerator, int denominator);
Fraction operator+(Fraction b);
Fraction operator-(Fraction b);
Fraction operator*(Fraction b);
Fraction operator/(Fraction b);
Fraction operator%(Fraction b);
Fraction operator-();
//void generate_prime_numbers(unsigned int right_border);
void reduce();
bool operator<(Fraction b);
bool operator>(Fraction b);
bool operator==(Fraction b);
friend std::ostream& operator<<(std::ostream &out, const Fraction &a);
friend std::istream& operator>>(std::istream &in, Fraction &a);
friend Fraction operator*(int a, Fraction b);
friend bool operator<(double a, Fraction b);
operator double();
operator int();
};
#endif //PARSER_FRACTION_H