Zero  0.1.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
decimal Class Reference

#include <decimal.h>

Public Member Functions

 decimal ()
 
 decimal (double value)
 
 decimal (int value)
 
decimaloperator+= (decimal const &other)
 
decimaloperator-= (decimal const &other)
 
decimal operator*= (decimal const &other)
 
decimal operator/= (decimal const &other)
 
decimal operator+ (decimal const &other) const
 
decimal operator- (decimal const &other) const
 
decimal operator* (decimal const &other) const
 
decimal operator/ (decimal const &other) const
 
decimaloperator++ ()
 
decimal operator++ (int)
 
decimaloperator-- ()
 
decimal operator-- (int)
 
double to_double () const
 
long long to_long () const
 
int to_int () const
 
bool operator< (decimal const &other) const
 
bool operator> (decimal const &other) const
 
bool operator== (decimal const &other) const
 
bool operator<= (decimal const &other) const
 
bool operator>= (decimal const &other) const
 
bool operator!= (decimal const &other) const
 

Private Member Functions

 decimal (int64_t value)
 

Private Attributes

int64_t _value
 

Detailed Description

A fixed-point decimal class. Able to represent up to 2^50 cents accurately, allowing numbers approaching 4 trillion or so.

Constructor & Destructor Documentation

§ decimal() [1/4]

decimal::decimal ( int64_t  value)
inlineexplicitprivate

§ decimal() [2/4]

decimal::decimal ( )
inline

§ decimal() [3/4]

decimal::decimal ( double  value)
inline

§ decimal() [4/4]

decimal::decimal ( int  value)
inline

Member Function Documentation

§ operator!=()

bool decimal::operator!= ( decimal const &  other) const
inline

§ operator*()

decimal decimal::operator* ( decimal const &  other) const
inline

§ operator*=()

decimal decimal::operator*= ( decimal const &  other)
inline

§ operator+()

decimal decimal::operator+ ( decimal const &  other) const
inline

§ operator++() [1/2]

decimal& decimal::operator++ ( )
inline

§ operator++() [2/2]

decimal decimal::operator++ ( int  )
inline

§ operator+=()

decimal& decimal::operator+= ( decimal const &  other)
inline

§ operator-()

decimal decimal::operator- ( decimal const &  other) const
inline

§ operator--() [1/2]

decimal& decimal::operator-- ( )
inline

§ operator--() [2/2]

decimal decimal::operator-- ( int  )
inline

§ operator-=()

decimal& decimal::operator-= ( decimal const &  other)
inline

§ operator/()

decimal decimal::operator/ ( decimal const &  other) const
inline

§ operator/=()

decimal decimal::operator/= ( decimal const &  other)
inline

§ operator<()

bool decimal::operator< ( decimal const &  other) const
inline

§ operator<=()

bool decimal::operator<= ( decimal const &  other) const
inline

§ operator==()

bool decimal::operator== ( decimal const &  other) const
inline

§ operator>()

bool decimal::operator> ( decimal const &  other) const
inline

§ operator>=()

bool decimal::operator>= ( decimal const &  other) const
inline

§ to_double()

double decimal::to_double ( ) const
inline

§ to_int()

int decimal::to_int ( ) const
inline

§ to_long()

long long decimal::to_long ( ) const
inline

Member Data Documentation

§ _value

int64_t decimal::_value
private

The documentation for this class was generated from the following file: