Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Заменяешь целиком
- Money& operator+(Money& obj)
- {
- double summary = to_double() + obj.to_double();
- double left, right;
- right = modf(to_double() + obj.to_double(), &left);
- right *= 100;
- _a = static_cast<int>(left);
- _b = static_cast<int>(right);
- return *this;
- }
- А это вставляешь в класс Moeny
- double to_double()
- {
- return double(_a + (_b / pow(10, CountNumbers(_b)) + 0.00000000001));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement