|
Public Methods |
| Currency () |
| Currency (const Currency &) |
| Currency (int rhs) |
| Currency (float rhs) |
| Currency (double rhs) |
| Currency (int integer, int fraction) |
| ~Currency () |
Currency & | operator= (const Currency &rhs) |
Currency & | operator= (const float rhs) |
Currency & | operator= (const int rhs) |
Currency & | operator+= (const Currency &rhs) |
Currency & | operator+= (const float rhs) |
Currency & | operator+= (const int rhs) |
Currency & | operator-= (const Currency &rhs) |
Currency & | operator-= (const float rhs) |
Currency & | operator-= (const int rhs) |
Currency & | operator *= (const Currency &rhs) |
Currency & | operator *= (const float rhs) |
Currency & | operator *= (const int rhs) |
Currency & | operator/= (const Currency &rhs) |
Currency & | operator/= (const float rhs) |
Currency & | operator/= (const int rhs) |
Currency | operator+ () const |
Currency | operator- () const |
| operator int () const |
| operator float () const |
| operator double () const |
string | toString () const |
Public Attributes |
int | value |
Friends |
Currency | operator- (const Currency &lhs, const Currency &rhs) |
Currency | operator- (const Currency &lhs, float rhs) |
Currency | operator- (const Currency &lhs, int rhs) |
Currency | operator+ (const Currency &lhs, const Currency &rhs) |
Currency | operator+ (const Currency &lhs, float rhs) |
Currency | operator+ (const Currency &lhs, int rhs) |
Currency | operator * (const Currency &lhs, const Currency &rhs) |
Currency | operator * (const Currency &lhs, float rhs) |
Currency | operator * (const Currency &lhs, int rhs) |
Currency | operator/ (const Currency &lhs, const Currency &rhs) |
Currency | operator/ (const Currency &lhs, float rhs) |
Currency | operator/ (const Currency &lhs, int rhs) |
bool | operator< (const Currency &lhs, const Currency &rhs) |
bool | operator< (const Currency &lhs, float rhs) |
bool | operator< (const Currency &lhs, int rhs) |
bool | operator> (const Currency &lhs, const Currency &rhs) |
bool | operator> (const Currency &lhs, float rhs) |
bool | operator> (const Currency &lhs, int rhs) |
bool | operator== (const Currency &lhs, const Currency &rhs) |
bool | operator== (const Currency &lhs, float rhs) |
bool | operator== (const Currency &lhs, int rhs) |
bool | operator!= (const Currency &lhs, const Currency &rhs) |
bool | operator!= (const Currency &lhs, float rhs) |
bool | operator!= (const Currency &lhs, int rhs) |
bool | operator<= (const Currency &lhs, const Currency &rhs) |
bool | operator<= (const Currency &lhs, float rhs) |
bool | operator<= (const Currency &lhs, int rhs) |
bool | operator>= (const Currency &lhs, const Currency &rhs) |
bool | operator>= (const Currency &lhs, float rhs) |
bool | operator>= (const Currency &lhs, int rhs) |
ostream & | operator<< (ostream &os, const Currency &rhs) |
Existing solutions implements fixed point type as a binary shift. This class implements operators in a decimal fixed point (x100) package. This class use only integer type. Example: Float type => 0.3333333 Currency type =>33 (integer) Operators: +,-,*,/,+=,-=,*=,/=,=,==,<,<=,>,>=,!=,(int),(float),(double), (string),<<