37 template <
class MantissaType,
class ExponentType >
40 MantissaType mantissa_;
41 ExponentType exponent_;
50 typedef MantissaType FirstArgType;
52 typedef ExponentType SecondArgType;
65 Size =
sizeof(Mantissa) +
sizeof(Exponent)
95 : mantissa_(other.mantissa_)
96 , exponent_(other.exponent_)
115 mantissa_ = other.mantissa_;
116 exponent_ = other.exponent_;
123 template<
class OtherMantissa,
class OtherExponent>
125 : mantissa_(other.mantissa())
126 , exponent_(other.exponent())
131 template <
class OtherMantissa,
class OtherExponent>
133 : mantissa_(other.mantissa())
134 , exponent_(other.exponent())
149 mantissa_ = other.mantissa();
150 exponent_ = other.exponent();
163 mantissa_ = other.mantissa();
164 exponent_ = other.exponent();
174 std::memcpy(addr, &mantissa_,
sizeof(mantissa_));
175 addr = advanceByBytes(addr,
sizeof(mantissa_));
177 std::memcpy(addr, &exponent_,
sizeof(exponent_));
190 MantissaType mantissa_;
199 typedef MantissaType FirstArgType;
212 Size =
sizeof(Mantissa)
231 : mantissa_(mantissa)
237 : mantissa_(other.mantissa_)
256 mantissa_ = other.mantissa_;
266 std::memcpy(addr, &mantissa_,
sizeof(mantissa_));
#define ONIXS_B3_BOE_MESSAGING_NAMESPACE_END
A real number with a floating exponent.
MantissaType Mantissa
Mantissa component type.
#define ONIXS_B3_BOE_NOTHROW
constexpr FloatingPointDecimal(const FloatingPointDecimal &other) noexcept
Initializes the instance as a copy of the given one.
std::string toStr(const FloatingPointDecimal< Mantissa, Exponent > &)
Serializes a floating-point decimal into a string.
constexpr FixedPointDecimal() noexcept
Default (zero) initialization.
ExponentType Exponent
Exponent component type.
Exponent exponent() const noexcept
#define ONIXS_B3_BOE_CONSTEXPR
MantissaType Mantissa
Mantissa component type.
constexpr FixedPointDecimal(Mantissa mantissa) noexcept
Explicitly initializes the instance from the mantissa value.
Exponent exponent() const noexcept
#define ONIXS_B3_BOE_NODISCARD
ExponentType Exponent
Exponent component type.
FloatingPointDecimal(const FixedPointDecimal< OtherMantissa, OtherExponent > &other) noexcept
Initializes the instance from the fixed point decimal.
constexpr FloatingPointDecimal(Mantissa mantissa, Exponent exponent) noexcept
Explicitly initializes the instance from the mantissa and exponent values.
constexpr FloatingPointDecimal() noexcept
Default (zero) initialization.
#define ONIXS_B3_BOE_MESSAGING_NAMESPACE_BEGIN
std::string toString() const
constexpr FixedPointDecimal(const FixedPointDecimal &other) noexcept
Initializes the instance as a copy of the given one.
Mantissa mantissa() const noexcept
void serialize(void *addr) const noexcept
Serialize to the given data buffer.
std::string toString() const
FloatingPointDecimal(const FloatingPointDecimal< OtherMantissa, OtherExponent > &other) noexcept
Initializes the instance from the floating point decimal.
Mantissa mantissa() const noexcept
void serialize(void *addr) const noexcept
Serializes to the given data buffer.