Commit 07227900350624af3d59c419f8dfc7c1d3c3221d

Authored by Jürgen Knödlseder
1 parent 2b6f365b

Correct -= operator.

The -= operator made an addition instead of a subtraction.
Showing 1 changed file with 14 additions and 14 deletions
include/GEnergy.hpp
... ... @@ -117,81 +117,81 @@ protected:
117 117 * Inline friends *
118 118 ***************************************************************************/
119 119 inline
120   -GEnergy& GEnergy::operator+= (const GEnergy& eng)
  120 +GEnergy& GEnergy::operator+=(const GEnergy& eng)
121 121 {
122 122 m_energy += eng.m_energy;
123 123 m_has_log10 = false;
124 124 return *this;
125 125 }
126 126 inline
127   -GEnergy& GEnergy::operator-= (const GEnergy& eng)
  127 +GEnergy& GEnergy::operator-=(const GEnergy& eng)
128 128 {
129   - m_energy += eng.m_energy;
  129 + m_energy -= eng.m_energy;
130 130 m_has_log10 = false;
131 131 return *this;
132 132 }
133 133 inline
134   -GEnergy operator+ (const GEnergy& a, const GEnergy& b)
  134 +GEnergy operator+(const GEnergy& a, const GEnergy& b)
135 135 {
136 136 GEnergy result;
137 137 result.m_energy = a.m_energy + b.m_energy;
138 138 return result;
139 139 }
140 140 inline
141   -GEnergy operator- (const GEnergy& a, const GEnergy& b)
  141 +GEnergy operator-(const GEnergy& a, const GEnergy& b)
142 142 {
143 143 GEnergy result;
144 144 result.m_energy = a.m_energy - b.m_energy;
145 145 return result;
146 146 }
147 147 inline
148   -GEnergy operator* (const double& a, const GEnergy& b)
  148 +GEnergy operator*(const double& a, const GEnergy& b)
149 149 {
150 150 GEnergy result;
151 151 result.m_energy = a * b.m_energy;
152 152 return result;
153 153 }
154 154 inline
155   -GEnergy operator* (const GEnergy& a, const double& b)
  155 +GEnergy operator*(const GEnergy& a, const double& b)
156 156 {
157 157 GEnergy result;
158 158 result.m_energy = b * a.m_energy;
159 159 return result;
160 160 }
161 161 inline
162   -GEnergy operator/ (const GEnergy& a, const double& b)
  162 +GEnergy operator/(const GEnergy& a, const double& b)
163 163 {
164 164 GEnergy result;
165 165 result.m_energy = a.m_energy / b;
166 166 return result;
167 167 }
168 168 inline
169   -bool operator== (const GEnergy &a, const GEnergy &b)
  169 +bool operator==(const GEnergy &a, const GEnergy &b)
170 170 {
171 171 return (a.m_energy == b.m_energy);
172 172 }
173 173 inline
174   -bool operator!= (const GEnergy &a, const GEnergy &b)
  174 +bool operator!=(const GEnergy &a, const GEnergy &b)
175 175 {
176 176 return (a.m_energy != b.m_energy);
177 177 }
178 178 inline
179   -bool operator< (const GEnergy &a, const GEnergy &b)
  179 +bool operator<(const GEnergy &a, const GEnergy &b)
180 180 {
181 181 return (a.m_energy < b.m_energy);
182 182 }
183 183 inline
184   -bool operator<= (const GEnergy &a, const GEnergy &b)
  184 +bool operator<=(const GEnergy &a, const GEnergy &b)
185 185 {
186 186 return (a.m_energy <= b.m_energy);
187 187 }
188 188 inline
189   -bool operator> (const GEnergy &a, const GEnergy &b)
  189 +bool operator>(const GEnergy &a, const GEnergy &b)
190 190 {
191 191 return (a.m_energy > b.m_energy);
192 192 }
193 193 inline
194   -bool operator>= (const GEnergy &a, const GEnergy &b)
  194 +bool operator>=(const GEnergy &a, const GEnergy &b)
195 195 {
196 196 return (a.m_energy >= b.m_energy);
197 197 }
... ...