44 MantissaType mantissa_;
62 Size =
sizeof(Mantissa)
82 : mantissa_(other.mantissa_)
103 mantissa_ = other.mantissa_;
119 <Mantissa, Exponent>& left,
122 <Mantissa, Exponent>& right)
124 return left.mantissa() == right.mantissa();
137 <Mantissa, Exponent>& left,
140 <Mantissa, Exponent>& right)
142 return left.mantissa() != right.mantissa();
155 <Mantissa, Exponent>& left,
158 <Mantissa, Exponent>& right)
160 return left.mantissa() < right.mantissa();
173 <Mantissa, Exponent>& left,
176 <Mantissa, Exponent>& right)
178 return left.mantissa() > right.mantissa();
191 <Mantissa, Exponent>& left,
194 <Mantissa, Exponent>& right)
196 return left.mantissa() <= right.mantissa();
209 <Mantissa, Exponent>& left,
212 <Mantissa, Exponent>& right)
214 return left.mantissa() >= right.mantissa();
240 : mantissa_(mantissa)
241 , exponent_(exponent)
248 : mantissa_(other.mantissa_)
249 , exponent_(other.exponent_)
262 <OtherMantissa, OtherExponent>& other)
263 : mantissa_(other.mantissa())
264 , exponent_(other.exponent())
285 mantissa_ = other.mantissa_;
286 exponent_ = other.exponent_;
301 <OtherMantissa, OtherExponent>& other)
304 exponent_ = other.exponent();
316 ONIXS_CMEMDH_EXPORTED
322 ONIXS_CMEMDH_EXPORTED
339 <Mantissa, Exponent>& right)
341 return (left ==
Decimal(right));
354 <Mantissa, Exponent>& left,
357 return (
Decimal(left) == right);
371 <Mantissa, Exponent>& right)
373 return (left !=
Decimal(right));
386 <Mantissa, Exponent>& left,
389 return (
Decimal(left) != right);
392 ONIXS_CMEMDH_EXPORTED
398 ONIXS_CMEMDH_EXPORTED
410 return (right < left);
424 <Mantissa, Exponent>& right)
426 return (left <
Decimal(right));
439 <Mantissa, Exponent>& left,
442 return (
Decimal(left) < right);
456 <Mantissa, Exponent>& right)
458 return (left >
Decimal(right));
471 <Mantissa, Exponent>& left,
474 return (
Decimal(left) > right);
479 ONIXS_CMEMDH_EXPORTED
524 <Mantissa, Exponent>& number)
bool operator==(const FixedPointDecimal< Mantissa, Exponent > &left, const Decimal &right)
#define ONIXS_CMEMDH_LTWT_CLASS
ONIXS_CMEMDH_EXPORTED bool operator<=(const Decimal &left, const Decimal &right)
Int32 Exponent
Aliases exponent component type.
Decimal()
Default (zero) initialization.
Decimal(const Decimal &other)
Initializes instance as copy of the other one.
std::string toStr(const FixedPointDecimal< Mantissa, Exponent > &number)
Serializes fixed-point decimal into a string.
Decimal(Mantissa mantissa, Exponent exponent)
Explicitly initializes instance from its mantissa value.
bool operator>(const FixedPointDecimal< Mantissa, Exponent > &left, const Decimal &right)
Mantissa mantissa() const
Returns mantissa of given decimal.
MantissaType Mantissa
Aliases mantissa component type.
Decimal(const FixedPointDecimal< OtherMantissa, OtherExponent > &other)
FixedPointDecimal(Mantissa mantissa)
Explicitly initializes instance from its mantissa value.
A real number with floating exponent.
#define ONIXS_CMEMDH_NAMESPACE_BEGIN
Mantissa mantissa() const
Returns mantissa of given decimal.
Exponent exponent() const
Returns exponent of given decimal.
Exponent exponent() const
Returns exponent of given decimal.
Int64 Mantissa
Aliases mantissa component type.
bool operator<(const FixedPointDecimal< Mantissa, Exponent > &left, const Decimal &right)
ExponentType Exponent
Aliases exponent component type.
FixedPointDecimal(const FixedPointDecimal &other)
Initializes instance as copy of the other one.
ONIXS_CMEMDH_EXPORTED void decimalToStr(std::string &, Int64, Int32)
bool operator!=(const FixedPointDecimal< Mantissa, Exponent > &left, const Decimal &right)
FixedPointDecimal()
Default (zero) initialization.
bool operator>=(const FixedPointDecimal< Mantissa, Exponent > &left, const FixedPointDecimal< Mantissa, Exponent > &right)
Compares two fixed-point decimals.
#define ONIXS_CMEMDH_NAMESPACE_END