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_ILINK3_CONSTEXPR
Exponent exponent() const noexcept
constexpr FixedPointDecimal(Mantissa mantissa) noexcept
Explicitly initializes the instance from the mantissa value.
A real number with a floating exponent.
std::string toString() const
FloatingPointDecimal(const FloatingPointDecimal< OtherMantissa, OtherExponent > &other) noexcept
Initializes the instance from the floating point decimal.
MantissaType Mantissa
Mantissa component type.
MantissaType Mantissa
Mantissa component type.
FloatingPointDecimal(const FixedPointDecimal< OtherMantissa, OtherExponent > &other) noexcept
Initializes the instance from the fixed point decimal.
constexpr FloatingPointDecimal(const FloatingPointDecimal &other) noexcept
Initializes the instance as a copy of the given one.
constexpr FixedPointDecimal() noexcept
Default (zero) initialization.
std::string toStr(const FloatingPointDecimal< Mantissa, Exponent > &)
Serializes a floating-point decimal into a string.
Mantissa mantissa() const noexcept
void serialize(void *addr) const noexcept
Serializes to the given data buffer.
ExponentType Exponent
Exponent component type.
constexpr FloatingPointDecimal() noexcept
Default (zero) initialization.
constexpr FloatingPointDecimal(Mantissa mantissa, Exponent exponent) noexcept
Explicitly initializes the instance from the mantissa and exponent values.
void serialize(void *addr) const noexcept
Serialize to the given data buffer.
ExponentType Exponent
Exponent component type.
#define ONIXS_ILINK3_MESSAGING_NAMESPACE_END
Exponent exponent() const noexcept
constexpr FixedPointDecimal(const FixedPointDecimal &other) noexcept
Initializes the instance as a copy of the given one.
#define ONIXS_ILINK3_MESSAGING_NAMESPACE_BEGIN
Mantissa mantissa() const noexcept
std::string toString() const
#define ONIXS_ILINK3_NODISCARD
#define ONIXS_ILINK3_NOTHROW