All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes | List of all members
ttmath::Dec< value_size, dec_digits > Class Template Reference

#include <ttmathdec.h>

Public Member Functions

 Dec ()
 
 Dec (const char *s)
 
Dec< value_size, dec_digits > & operator= (const char *s)
 
uint FromString (const char *s, const char **after_source=0, bool *value_read=0)
 
void ToString (std::string &result) const
 
void ClearInfoBit (unsigned char bit)
 
void SetInfoBit (unsigned char bit)
 
bool IsInfoBit (unsigned char bit) const
 
bool IsNan () const
 
bool IsSign () const
 
void SetSign ()
 
void SetNaN ()
 
void Abs ()
 
uint Add (const Dec< value_size, dec_digits > &arg)
 

Public Attributes

UInt< value_size > value
 
unsigned char info
 

Constructor & Destructor Documentation

template<uint value_size, uint dec_digits>
ttmath::Dec< value_size, dec_digits >::Dec ( )
inline
template<uint value_size, uint dec_digits>
ttmath::Dec< value_size, dec_digits >::Dec ( const char *  s)
inline

Member Function Documentation

template<uint value_size, uint dec_digits>
void ttmath::Dec< value_size, dec_digits >::Abs ( )
inline
template<uint value_size, uint dec_digits>
uint ttmath::Dec< value_size, dec_digits >::Add ( const Dec< value_size, dec_digits > &  arg)
inline
template<uint value_size, uint dec_digits>
void ttmath::Dec< value_size, dec_digits >::ClearInfoBit ( unsigned char  bit)
inline

this method clears a specific bit in the 'info' variable

bit is one of:

template<uint value_size, uint dec_digits>
uint ttmath::Dec< value_size, dec_digits >::FromString ( const char *  s,
const char **  after_source = 0,
bool *  value_read = 0 
)
inline
template<uint value_size, uint dec_digits>
bool ttmath::Dec< value_size, dec_digits >::IsInfoBit ( unsigned char  bit) const
inline

this method returns true if a specific bit in the 'info' variable is set

bit is one of:

template<uint value_size, uint dec_digits>
bool ttmath::Dec< value_size, dec_digits >::IsNan ( ) const
inline
template<uint value_size, uint dec_digits>
bool ttmath::Dec< value_size, dec_digits >::IsSign ( ) const
inline
template<uint value_size, uint dec_digits>
Dec<value_size, dec_digits>& ttmath::Dec< value_size, dec_digits >::operator= ( const char *  s)
inline
template<uint value_size, uint dec_digits>
void ttmath::Dec< value_size, dec_digits >::SetInfoBit ( unsigned char  bit)
inline

this method sets a specific bit in the 'info' variable

bit is one of:

template<uint value_size, uint dec_digits>
void ttmath::Dec< value_size, dec_digits >::SetNaN ( )
inline
template<uint value_size, uint dec_digits>
void ttmath::Dec< value_size, dec_digits >::SetSign ( )
inline

this method sets the sign

e.g.
-1 -> -1
2  -> -2

we do not check whether there is a zero or not, if you're using this method you must be sure that the value is (or will be afterwards) different from zero

template<uint value_size, uint dec_digits>
void ttmath::Dec< value_size, dec_digits >::ToString ( std::string &  result) const
inline

Member Data Documentation

template<uint value_size, uint dec_digits>
unsigned char ttmath::Dec< value_size, dec_digits >::info
template<uint value_size, uint dec_digits>
UInt<value_size> ttmath::Dec< value_size, dec_digits >::value

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