1 \addtogroup new-price-type
3 \brief Important aspects of working with decimal numbers like prices.
5 Manipulating prices as values of `double` type may lead to calculation
6 mistakes caused by the way real numbers are presented in `double` values
7 as well as due to the type capacity limits.
9 Assume the following initialization of a variable of the `double` type is executed:
12 const double Price = 100.10;
15 In spite of exact constant definition, the real value, hold by a defined variable,
16 looks like `100.099999999999998`, but not `100.1`.
18 This is because each double value is expressed as `X * 2 ^ Y`, where
19 `X` is mantissa and `Y` is 2-basis exponent.
21 As a result, each time the price field is accessed, conversion mistakes might happen.
23 Since recently, CME MDP uses a real number with a fixed decimal exponent.
24 Therefore, the SDK exposes the OnixS::CME::MDH::FixPointDecimal class for
25 a better experience with original data, transmitted by MDP, and to avoid
26 issues described above.
28 In contrast to a `double` type, available as a native C++ data type,
29 the OnixS::CME::MDH::FixedPointDecimal class presents real numbers with
30 the constant 10-basis exponent. Therefore, each number looks like
31 `X * 10 ^ Y`, where `X` is a mantissa and `Y` is an exponent.