OSB_LIB::Decimal Class Reference

Collaboration diagram for OSB_LIB::Decimal:

Collaboration graph
[legend]
List of all members.

Detailed Description

Provide non-integer numbers without rounding errors.

Definition at line 50 of file decimal.h.

Public Member Functions

Static Public Member Functions

Static Public Attributes

Private Member Functions

Private Attributes

Static Private Attributes

Friends


Constructor & Destructor Documentation

OSB_LIB::Decimal::Decimal (  )  [inline]

Definition at line 67 of file decimal.h.

References value_.

OSB_LIB::Decimal::Decimal ( int  v  )  [inline]

Definition at line 68 of file decimal.h.

References longToDecimal(), and value_.

OSB_LIB::Decimal::Decimal ( long  v  )  [inline]

Definition at line 69 of file decimal.h.

References longToDecimal(), and value_.

OSB_LIB::Decimal::Decimal ( long long  v  )  [inline]

Definition at line 70 of file decimal.h.

References longToDecimal(), and value_.

OSB_LIB::Decimal::Decimal ( double  v  )  [inline]

Definition at line 71 of file decimal.h.

References doubleToDecimal(), and value_.

OSB_LIB::Decimal::Decimal ( const Decimal d  )  [inline]

Definition at line 72 of file decimal.h.


Member Function Documentation

long OSB_LIB::Decimal::ceil (  )  const

Return the ceiling of decimal (e.g. 3 from 2.89).

long long OSB_LIB::Decimal::doubleToDecimal ( double   )  [private]

Referenced by Decimal().

double OSB_LIB::Decimal::frac (  )  const

Return the fractional part of decimal (e.g. 0.89 from 2.89).

long long OSB_LIB::Decimal::longToDecimal ( long  long  )  [private]

Referenced by Decimal().

Decimal& OSB_LIB::Decimal::operator *= ( const Decimal  ) 

Decimal& OSB_LIB::Decimal::operator+= ( const Decimal  ) 

Decimal & OSB_LIB::Decimal::operator- (  )  [inline]

Definition at line 135 of file decimal.h.

References value_.

Decimal& OSB_LIB::Decimal::operator-= ( const Decimal  ) 

Decimal& OSB_LIB::Decimal::operator/= ( const Decimal  ) 

Decimal & OSB_LIB::Decimal::operator= ( const Decimal  )  [inline]

Definition at line 129 of file decimal.h.

References value_.

static long OSB_LIB::Decimal::power (  )  [inline, static]

Definition at line 94 of file decimal.h.

References power_.

static int OSB_LIB::Decimal::precision ( int  p = -1  )  [static]

std::string OSB_LIB::Decimal::str (  )  const

Return the decimal as a string.

double OSB_LIB::Decimal::toDouble (  )  const

Decimal may be trancated for value above 100 million.

long OSB_LIB::Decimal::trunc (  )  const

Return the truncated value of decimal (e.g. 2 from 2.89).


Friends And Related Function Documentation

bool operator!= ( const Decimal d1,
const Decimal d2 
) [friend]

Definition at line 194 of file decimal.h.

bool operator< ( const Decimal d1,
const Decimal d2 
) [friend]

Definition at line 199 of file decimal.h.

bool operator<= ( const Decimal d1,
const Decimal d2 
) [friend]

Definition at line 209 of file decimal.h.

bool operator== ( const Decimal d1,
const Decimal d2 
) [friend]

Definition at line 189 of file decimal.h.

bool operator> ( const Decimal d1,
const Decimal d2 
) [friend]

Definition at line 204 of file decimal.h.

bool operator>= ( const Decimal d1,
const Decimal d2 
) [friend]

Definition at line 214 of file decimal.h.

friend class RoundUp [friend]

Definition at line 52 of file decimal.h.


Member Data Documentation

long OSB_LIB::Decimal::power_ [static, private]

Definition at line 110 of file decimal.h.

Referenced by power().

int OSB_LIB::Decimal::precision_ [static, private]

Definition at line 105 of file decimal.h.

long long OSB_LIB::Decimal::value_ [private]

Definition at line 114 of file decimal.h.

Referenced by Decimal(), OSB_LIB::operator!=(), operator-(), OSB_LIB::operator<(), OSB_LIB::operator<=(), operator=(), OSB_LIB::operator==(), OSB_LIB::operator>(), and OSB_LIB::operator>=().

const long long OSB_LIB::Decimal::valueMax = 0x7fffffffffffffffLL [static]

Maximum value for long long: no standard define exists.

Definition at line 62 of file decimal.h.

const long long OSB_LIB::Decimal::valueMin = ~valueMax [static]

Minium value for long long: no standard define exists.

Definition at line 64 of file decimal.h.


The documentation for this class was generated from the following file:
Generated on Sat Sep 2 14:11:08 2006 for OSB Library by  doxygen 1.4.7