B2BITS FIX Antenna C++ 2.33.0
|
Encapsulates float type. More...
#include <B2BITS_Decimal.h>
Public Member Functions | |
Decimal | changeExponent (System::i32 newExponent) const throw () |
Returns new Decimal value with required exponent. | |
Decimal () throw () | |
Default contructor. | |
Decimal (double v) throw () | |
Contructor Constructs object from double. | |
Decimal (System::i64 m, System::i32 e) throw () | |
Contructor Constructs object from mantissa and exponent. | |
Decimal (System::i64 x) throw () | |
Contructor Constructs object from 64-bit integer. | |
bool | equals (const Decimal &rv) const throw () |
Compares two Decimals. | |
System::i32 | exponent () const throw () |
Returns exponent part of the value. | |
System::i32 | getExponent () const throw () |
Returns exponent part of the value. | |
System::i64 | getMantissa () const throw () |
Returns mantissa part of the value. | |
System::i64 | mantissa () const throw () |
Returns mantissa part of the value. | |
bool | operator!= (Engine::Decimal const &val) const throw () |
Compares two decimals. | |
Decimal | operator* (Engine::Decimal const &val) const throw () |
Multiplication operator. | |
Decimal & | operator*= (Engine::Decimal const &val) throw () |
Multiplication assignment. | |
Decimal | operator+ (Engine::Decimal const &val) const throw () |
Addition operator. | |
Decimal & | operator++ () throw () |
Prefix increment. | |
Decimal | operator++ (int) throw () |
Postfix increment. | |
Decimal & | operator+= (Engine::Decimal const &val) throw () |
Addition assignment. | |
Decimal | operator- (Engine::Decimal const &val) const throw () |
Substraction operator. | |
Decimal & | operator-- () throw () |
Prefix decrement. | |
Decimal | operator-- (int) throw () |
Postfix decrement. | |
Decimal & | operator-= (Engine::Decimal const &val) throw () |
Subtraction assignment. | |
bool | operator< (Engine::Decimal const &val) const throw () |
Compares two decimals. | |
bool | operator<= (Engine::Decimal const &val) const throw () |
Compares two decimals. | |
bool | operator== (Engine::Decimal const &val) const throw () |
Compares two decimals. | |
bool | operator> (Engine::Decimal const &val) const throw () |
Compares two decimals. | |
bool | operator>= (Engine::Decimal const &val) const throw () |
Compares two decimals. | |
double | toDouble () const throw () |
Converts stored value to double. | |
float | toFloat () const throw () |
Converts stored value to float. | |
std::string | toStdString () const |
Converts decimal to FIX string. | |
char * | toString (char *buf) const throw () |
Converts decimal to FIX string. | |
char * | toString (char *buf, std::size_t size) const throw () |
If result string is less than passed buffer, remain chars will be filled with zeros according to FIX protocol. | |
Static Public Member Functions | |
static Decimal | fromDouble (double v) throw () |
Contructor Constructs object from double. | |
static Decimal | fromDouble (double v, int precision) throw () |
Contructor Constructs object from double. | |
static Decimal | fromFixString (AsciiString str) throw () |
Converts string to Decimal. | |
static Decimal | fromString (AsciiString str) throw () |
Converts string to Decimal. | |
static Decimal | fromString (WideString str) throw () |
Converts wide-string to Decimal. | |
Static Public Attributes | |
static unsigned int const | ValueSize = 2 + 63 + sizeof( "18446744073709551616" ) |
Maximum buffer size required to store value. | |
Encapsulates float type.
Engine::Decimal::Decimal | ( | ) | ||||
throw | ( | ) |
Default contructor.
Engine::Decimal::Decimal | ( | System::i64 | m, | |||
System::i32 | e ) | |||||
throw | ( | ) |
Contructor Constructs object from mantissa and exponent.
m | Mantissa |
e | Exponent |
Engine::Decimal::Decimal | ( | double | v | ) | ||
throw | ( | ) |
Contructor Constructs object from double.
v | Value of the double type |
Engine::Decimal::Decimal | ( | System::i64 | x | ) | ||
throw | ( | ) |
Contructor Constructs object from 64-bit integer.
x | Value of the i64 type |
Decimal Engine::Decimal::changeExponent | ( | System::i32 | newExponent | ) | const | |
throw | ( | ) |
Returns new Decimal value with required exponent.
newExponent | Required exponent. Must be in range [currentExponent-18 .. currentExponent+18] |
bool Engine::Decimal::equals | ( | const Decimal & | rv | ) | const | |
throw | ( | ) |
Compares two Decimals.
rv | Value to compare with. |
|
inline |
Returns exponent part of the value.
|
static |
Contructor Constructs object from double.
v | Value of the double type |
|
static |
Contructor Constructs object from double.
v | Value of the double type |
precision | Number of digits after point. Must be in range [0..17] |
|
inlinestatic |
Converts string to Decimal.
|
static |
Converts string to Decimal.
|
static |
Converts wide-string to Decimal.
|
inline |
Returns exponent part of the value.
|
inline |
Returns mantissa part of the value.
|
inline |
Returns mantissa part of the value.
bool Engine::Decimal::operator!= | ( | Engine::Decimal const & | val | ) | const | |
throw | ( | ) |
Compares two decimals.
|
inline |
Multiplication operator.
|
inline |
Multiplication assignment.
|
inline |
Addition operator.
|
inline |
Prefix increment.
|
inline |
Postfix increment.
|
inline |
Addition assignment.
|
inline |
Substraction operator.
|
inline |
Prefix decrement.
|
inline |
Postfix decrement.
|
inline |
Subtraction assignment.
bool Engine::Decimal::operator< | ( | Engine::Decimal const & | val | ) | const | |
throw | ( | ) |
Compares two decimals.
bool Engine::Decimal::operator<= | ( | Engine::Decimal const & | val | ) | const | |
throw | ( | ) |
Compares two decimals.
bool Engine::Decimal::operator== | ( | Engine::Decimal const & | val | ) | const | |
throw | ( | ) |
Compares two decimals.
bool Engine::Decimal::operator> | ( | Engine::Decimal const & | val | ) | const | |
throw | ( | ) |
Compares two decimals.
bool Engine::Decimal::operator>= | ( | Engine::Decimal const & | val | ) | const | |
throw | ( | ) |
Compares two decimals.
double Engine::Decimal::toDouble | ( | ) | const | |||
throw | ( | ) |
Converts stored value to double.
float Engine::Decimal::toFloat | ( | ) | const | |||
throw | ( | ) |
Converts stored value to float.
std::string Engine::Decimal::toStdString | ( | ) | const |
Converts decimal to FIX string.
Converts decimal to FIX string
char * Engine::Decimal::toString | ( | char * | buf | ) | const | |
throw | ( | ) |
Converts decimal to FIX string.
[out] | buf | Buffer to convert to. Should be enough to store Engine::Decimal::ValueSize bytes. |
char * Engine::Decimal::toString | ( | char * | buf, | |||
std::size_t | size ) const | |||||
throw | ( | ) |
If result string is less than passed buffer, remain chars will be filled with zeros according to FIX protocol.
[out] | buf | Buffer to convert to. |
[in] | size | Size of the buffer. Must be positive. |
|
static |
Maximum buffer size required to store value.