36void throwCannotQuantizeOrConvert();
74template <
class MantissaType>
83 if(
static_cast<MantissaType
>(
84 (std::numeric_limits<MantissaType>::max)()) >= res)
86 return static_cast<MantissaType
>(res);
89 throwCannotQuantizeOrConvert();
115 if(
static_cast<MantissaType
>(
116 (std::numeric_limits<MantissaType>::max)()) < number.
mantissa())
118 throwCannotQuantizeOrConvert();
123 static_cast<MantissaType
>(number.
mantissa()),
138typename EnableIf<details::IsDecimal<DecimalT>::value, DecimalT>::type
160 const Decimal& right);
168 const Decimal& right);
176 const Decimal& right)
178 return (right < left);
187 const Decimal& right)
189 return (right <= left);
238 const Decimal& number)
260 <Mantissa, Exponent>& number)
280 std::ostream& stream,
283 <Mantissa, Exponent>& value)
289 return stream << str;
304 <Mantissa, Exponent>& number)
357std::ostream& operator << (std::ostream& stream,
const Decimal& value)
363 return stream << str;
375 std::ostream& stream,
378 <Mantissa, Exponent>& value)
384 return stream << str;
394 const Decimal1& arg1,
const Decimal2& arg2)
396 if(isNull(arg1) || isNull(arg2))
397 throw std::invalid_argument(
"Provided argument is Null.");
412 <Mantissa, Exponent>& left,
415 <Mantissa, Exponent>& right)
420 return left.mantissa() == right.mantissa();
435 <Mantissa, Exponent>& left,
438 <Mantissa, Exponent>& right)
440 return !(left == right);
455 <Mantissa, Exponent>& left,
458 <Mantissa, Exponent>& right)
460 checkAgsValid(left, right);
462 return left.mantissa() < right.mantissa();
477 <Mantissa, Exponent>& left,
480 <Mantissa, Exponent>& right)
482 checkAgsValid(left, right);
484 return left.mantissa() > right.mantissa();
499 <Mantissa, Exponent>& left,
502 <Mantissa, Exponent>& right)
504 checkAgsValid(left, right);
506 return left.mantissa() <= right.mantissa();
521 <Mantissa, Exponent>& left,
524 <Mantissa, Exponent>& right)
526 checkAgsValid(left, right);
528 return left.mantissa() >= right.mantissa();
539typename EnableIf<details::AreBothDecimals<Decimal1, Decimal2>::value,
bool>::type
541 const Decimal1& left,
const Decimal2& right)
543 bool isNullLeft =
isNull(left);
544 bool isNullRight =
isNull(right);
546 if (isNullLeft && isNullRight)
560typename EnableIf<details::AreBothDecimals<Decimal1, Decimal2>::value,
bool>::type
562 const Decimal1& left,
const Decimal2& right)
564 return !(left == right);
575typename EnableIf<details::AreBothDecimals<Decimal1, Decimal2>::value,
bool>::type
577 const Decimal1& left,
const Decimal2& right)
579 checkAgsValid(left, right);
592typename EnableIf<details::AreBothDecimals<Decimal1, Decimal2>::value,
bool>::type
594 const Decimal1& left,
const Decimal2& right)
596 checkAgsValid(left, right);
609typename EnableIf<details::AreBothDecimals<Decimal1, Decimal2>::value,
bool>::type
611 const Decimal1& left,
const Decimal2& right)
613 checkAgsValid(left, right);
626typename EnableIf<details::AreBothDecimals<Decimal1, Decimal2>::value,
bool>::type
628 const Decimal1& left,
const Decimal2& right)
630 checkAgsValid(left, right);
#define ONIXS_CONFLATEDTCP_MESSAGING_MDP_NAMESPACE_BEGIN
#define ONIXS_CONFLATEDTCP_MESSAGING_MDP_NAMESPACE_END
#define ONIXS_CONFLATEDTCP_PURE
#define ONIXS_CONFLATEDTCP_NORETURN
#define ONIXS_CONFLATEDTCP_CONSTEXPR
#define ONIXS_CONFLATEDTCP_EXPORTED
#define ONIXS_CONFLATEDTCP_NOTHROW
#define ONIXS_CONFLATEDTCP_NODISCARD
#define ONIXS_CONFLATEDTCP_COLDPATH
A real number with a floating exponent.
Exponent exponent() const noexcept
Mantissa mantissa() const noexcept
std::ostream & operator<<(std::ostream &stream, const FloatingPointDecimal< Mantissa, Exponent > &value)
Serializes into a stream.
bool isNull(const PRICE9 &value) noexcept
FloatingPointDecimal< Int64, Int32 > Decimal
Universal decimal type.
bool operator!=(const FixedPointDecimal< Mantissa, Exponent > &left, const FixedPointDecimal< Mantissa, Exponent > &right)
Compares two fixed-point decimals.
MantissaType quantizedMantissa(const Decimal &operand, Int32 exponent)
Quantize so its exponent is the same as that of provided value.
std::string toStr(const FixedPointDecimal< Mantissa, Exponent > &)
Serializes a fixed-point decimal into a string.
bool quantize(const Decimal &operand, Int32 exponent, Decimal &quantized)
Quantize so its exponent is the same as that of provided value.
void convert(FixedPointDecimal< MantissaType, ExponentType > &res, const Decimal &number)
bool fromStr(Decimal &, const Char *, size_t) noexcept
Deserializes a decimal number from the given text presentation.
char Char
Character type alias.
void toStr(std::string &str, const Negotiate200 &obj)
Serializes into a string.