Indentation
This commit is contained in:
parent
8dda4fe71b
commit
aec0995aaf
1 changed files with 171 additions and 177 deletions
|
@ -34,10 +34,10 @@ class fraction {
|
|||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
public:
|
||||
// Constructors
|
||||
fraction() {
|
||||
}
|
||||
fraction() {}
|
||||
fraction(const fraction &q) {
|
||||
signed long long hcf = gcd(q.n, q.d);
|
||||
n = q.n / hcf;
|
||||
|
@ -70,15 +70,9 @@ class fraction {
|
|||
d = q.d;
|
||||
}
|
||||
// Member functions
|
||||
int get_sign() const {
|
||||
return (!(n >= 0) != !(d >=0)) ? -1 : 1;
|
||||
}
|
||||
signed long long get_n() const {
|
||||
return n;
|
||||
}
|
||||
signed long long get_d() const {
|
||||
return d;
|
||||
}
|
||||
int get_sign() const { return (!(n >= 0) != !(d >= 0)) ? -1 : 1; }
|
||||
signed long long get_n() const { return n; }
|
||||
signed long long get_d() const { return d; }
|
||||
double to_double() const {
|
||||
double dec = (double)n / (double)d;
|
||||
return dec;
|
||||
|
|
Loading…
Add table
Reference in a new issue