-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPhysicalNumber.h
More file actions
61 lines (47 loc) · 1.98 KB
/
Copy pathPhysicalNumber.h
File metadata and controls
61 lines (47 loc) · 1.98 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
50
51
52
53
54
55
56
57
58
59
60
61
//
// PhysicalNumber.h
// PhysicalNumber
//
// Created by Jeme Jbareen on 4/2/19.
// Copyright © 2019 Jeme Jbareen. All rights reserved.
//
#ifndef PhysicalNumber_h
#define PhysicalNumber_h
#include <iostream>
#include "Unit.h"
using std::ostream,std::istream;
namespace ariel{
class PhysicalNumber {
private:
double _num;
Unit _type;
double Diff(const PhysicalNumber &a) const;
bool checkType(const PhysicalNumber &a) const;
public:
double get_num() const;
Unit get_type() const;
PhysicalNumber(double numb,Unit type):_num(numb),_type(type){};
const PhysicalNumber operator+(const PhysicalNumber& a) const;
const PhysicalNumber operator-(const PhysicalNumber& a) const;
PhysicalNumber& operator+=(const PhysicalNumber& a);
PhysicalNumber& operator-=(const PhysicalNumber& a);
PhysicalNumber& operator=(const PhysicalNumber& a);
const PhysicalNumber operator+() const ;
const PhysicalNumber operator-() const ;
const bool operator==(const PhysicalNumber &a) const;
const bool operator<(const PhysicalNumber &a) const;
const bool operator>(const PhysicalNumber &a) const;
const bool operator<=(const PhysicalNumber &a) const;
const bool operator>=(const PhysicalNumber &a) const;
const bool operator!=(const PhysicalNumber &a) const;
const PhysicalNumber operator++ (int);
const PhysicalNumber operator--(int);
PhysicalNumber& operator++();
PhysicalNumber& operator--();
friend std::ostream& operator<< (std::ostream& os, const PhysicalNumber& a);
friend std::istream& operator>> (std::istream& is, PhysicalNumber& a);
};
std::ostream& operator<< (std::ostream& os, const PhysicalNumber& a);
std::istream& operator>>(std::istream& is, PhysicalNumber& a);
}
#endif /* PhysicalNumber_h */