31template <
class MantissaType,
class ExponentType>
class FixedPointDecimal;
32template <
class MantissaType,
class ExponentType>
class FloatingPointDecimal;
33template<
class Mantissa,
class Exponent> std::string
toStr(
const FixedPointDecimal <Mantissa, Exponent>&);
34template<
class Mantissa,
class Exponent> std::string
toStr(
const FloatingPointDecimal <Mantissa, Exponent>&);
37template <
class MantissaType,
class ExponentType >
40 MantissaType mantissa_;
41 ExponentType exponent_;
50 typedef MantissaType FirstArgType;
52 typedef ExponentType SecondArgType;
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;
237 : mantissa_(other.mantissa_)
256 mantissa_ = other.mantissa_;
266 std::memcpy(addr, &mantissa_,
sizeof(mantissa_));
#define ONIXS_ILINK3_MESSAGING_NAMESPACE_END
#define ONIXS_ILINK3_MESSAGING_NAMESPACE_BEGIN
#define ONIXS_ILINK3_NODISCARD
#define ONIXS_ILINK3_CONSTEXPR
#define ONIXS_ILINK3_NOTHROW
IntegralConstant< Int8, -9 > Exponent
std::string toString() const
constexpr FixedPointDecimal(const FixedPointDecimal &other) noexcept
Initializes the instance as a copy of the given one.
constexpr FixedPointDecimal(Mantissa mantissa) noexcept
Explicitly initializes the instance from the mantissa value.
Exponent exponent() const noexcept
void serialize(void *addr) const noexcept
Serialize to the given data buffer.
constexpr FixedPointDecimal() noexcept
Default (zero) initialization.
Mantissa mantissa() const noexcept
A real number with a floating exponent.
std::string toString() const
constexpr FloatingPointDecimal() noexcept
Default (zero) initialization.
constexpr FloatingPointDecimal(Mantissa mantissa, Exponent exponent) noexcept
Explicitly initializes the instance from the mantissa and exponent values.
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.
Exponent exponent() const noexcept
void serialize(void *addr) const noexcept
Serializes to the given data buffer.
Mantissa mantissa() const noexcept
FloatingPointDecimal(const FloatingPointDecimal< OtherMantissa, OtherExponent > &other) noexcept
Initializes the instance from the floating point decimal.
std::string toStr(const FixedPointDecimal< Mantissa, Exponent > &)
Serializes a fixed-point decimal into a string.