35 #ifndef _Wolframe_TYPES_BIG_NUMBER_HPP_INCLUDED
36 #define _Wolframe_TYPES_BIG_NUMBER_HPP_INCLUDED
39 #include <boost/shared_ptr.hpp>
75 BigNumber(
const char* val, std::size_t valsize);
81 BigNumber(
bool sign_,
unsigned short precision_,
signed short scale_,
const unsigned char* digits_);
150 void constructor(
const char* val, std::size_t valsize);
162 BigNumber(
const ConstQualifier&,
bool sign_,
unsigned short precision_,
signed short scale_,
const unsigned char* digits_);
187 BigNumberConst(
bool sign_,
unsigned short precision_,
signed short scale_,
const unsigned char* digits_)
bool operator==(const BigNumber &o) const
Test argument big number for equality.
Definition: bignumber.hpp:122
bool operator>(const BigNumber &o) const
Test if this big number is bigger than argument.
Definition: bignumber.hpp:131
signed short m_scale
scale number of digits right of the comma
Definition: bignumber.hpp:165
Application wide definitions of integer number value types.
std::string tostring() const
Get the number value as printable string.
double todouble() const
Get the number value as double precision floating point number if a conversion is possible...
unsigned short size() const
Get the size of the number (number of significant digits)
Definition: bignumber.hpp:93
const unsigned char * digits() const
Get the significant digits of the number.
Definition: bignumber.hpp:99
bool operator<(const BigNumber &o) const
Test if this big number is smaller than argument.
Definition: bignumber.hpp:137
BigNumberConst(const BigNumberConst &o)
Copy constructor.
Definition: bignumber.hpp:191
ConstQualifier
Definition: bignumber.hpp:156
Type for representing big numbers as binary coded decimal (BCD) numbers.
Definition: bignumber.hpp:49
unsigned short m_size
size of 'm_ar' in bytes
Definition: bignumber.hpp:168
bool isvalid() const
Check if the number is valid.
unsigned short precision() const
Get the number of significant digits (also the number of elements in digits())
Definition: bignumber.hpp:87
int compare(const BigNumber &o) const
Compare with argument.
BigNumberConst()
Default constructor.
Definition: bignumber.hpp:180
signed short scale() const
Get the number of digits right of the comma.
Definition: bignumber.hpp:90
#define _WOLFRAME_UINTEGER
Definition: integer.hpp:42
bool operator<=(const BigNumber &o) const
Test if this big number is smaller or equal than argument.
Definition: bignumber.hpp:134
Forward declaration.
Definition: variant.hpp:65
_WOLFRAME_INTEGER toint() const
Get the number value as integer if a conversion is possible.
Definition: bignumber.hpp:156
bool m_sign
sign (true, if the number is negative, false if positive or 0)
Definition: bignumber.hpp:166
_WOLFRAME_UINTEGER touint() const
Get the number value as unsigned integer if a conversion is possible.
#define _WOLFRAME_INTEGER
Definition: integer.hpp:41
BigNumberConst(bool sign_, unsigned short precision_, signed short scale_, const unsigned char *digits_)
Constructor.
Definition: bignumber.hpp:187
void constructor(const std::string &val)
Constructor function.
Constant big number that is not owned by the structure (caller has ownership)
Definition: bignumber.hpp:175
unsigned char * m_ar
decimal digits of the number [0x00..0x09]
Definition: bignumber.hpp:169
BigNumber()
Default constructor.
bool operator>=(const BigNumber &o) const
Test if this big number is bigger or equal than argument.
Definition: bignumber.hpp:128
std::string tostringNormalized() const
Get the number value as printable string in normalized form ([0..1] + exponent if scale < 0 or scale ...
bool sign() const
Get the sign of the number (true -> negative number)
Definition: bignumber.hpp:96
bool operator!=(const BigNumber &o) const
Test argument big number for inequality.
Definition: bignumber.hpp:125
bool m_const
true if the value is not allocated (no ownership)
Definition: bignumber.hpp:167