43 : _value((int64_t)(value * 100)) {}
46 : _value((int64_t)(value * 100)) {}
59 _value = (_value * other.
_value + 50) / 100;
64 _value = (100 * _value + 50) / other.
_value;
107 return ((
double)_value / (
double)100);
111 return (_value + 50) / 100;
119 return _value < other.
_value;
123 return _value > other.
_value;
127 return _value == other.
_value;
131 return _value <= other.
_value;
135 return _value >= other.
_value;
139 return _value != other.
_value;
175 #endif // __DECIMAL_H int64_t _value
Definition: decimal.h:33
decimal operator+(decimal const &other) const
Definition: decimal.h:68
decimal(int value)
Definition: decimal.h:45
decimal operator--(int)
Definition: decimal.h:100
decimal operator++(int)
Definition: decimal.h:89
decimal & operator+=(decimal const &other)
Definition: decimal.h:48
bool operator>=(decimal const &other) const
Definition: decimal.h:134
decimal operator/=(decimal const &other)
Definition: decimal.h:63
bool operator<=(decimal const &other) const
Definition: decimal.h:130
decimal(double value)
Definition: decimal.h:42
bool operator>(decimal const &other) const
Definition: decimal.h:122
decimal(int64_t value)
Definition: decimal.h:35
decimal & operator-=(decimal const &other)
Definition: decimal.h:53
int to_int() const
Definition: decimal.h:114
long long to_long() const
Definition: decimal.h:110
decimal operator*(decimal const &other) const
Definition: decimal.h:76
decimal & operator++()
Definition: decimal.h:84
decimal operator-(decimal const &other) const
Definition: decimal.h:72
decimal operator*=(decimal const &other)
Definition: decimal.h:58
double to_double() const
Definition: decimal.h:106
decimal()
Definition: decimal.h:39
bool operator==(decimal const &other) const
Definition: decimal.h:126
decimal operator/(decimal const &other) const
Definition: decimal.h:80
bool operator<(decimal const &other) const
Definition: decimal.h:118
decimal & operator--()
Definition: decimal.h:95
bool operator!=(decimal const &other) const
Definition: decimal.h:138