20#ifndef RIPPLE_PROTOCOL_AMOUNTCONVERSION_H_INCLUDED
21#define RIPPLE_PROTOCOL_AMOUNTCONVERSION_H_INCLUDED
23#include <xrpl/protocol/IOUAmount.h>
24#include <xrpl/protocol/STAmount.h>
25#include <xrpl/protocol/XRPAmount.h>
34 bool const isNeg = iou.
signum() < 0;
48 bool const isNeg = xrp.
signum() < 0;
58 "ripple::toSTAmount : is XRP");
79 "ripple::toAmount<IOUAmount> : maximum mantissa");
84 XRPL_ASSERT(!
isXRP(amt),
"ripple::toAmount<IOUAmount> : is not XRP");
94 "ripple::toAmount<XRPAmount> : maximum mantissa");
99 XRPL_ASSERT(
isXRP(amt),
"ripple::toAmount<XRPAmount> : is XRP");
149 static_assert(alwaysFalse,
"Unsupported type for toAmount");
171 static_assert(alwaysFalse,
"Unsupported type for toMaxAmount");
197 static_assert(alwaysFalse,
"Unsupported type for getIssue");
214 static_assert(alwaysFalse,
"Unsupported type for get");
Floating point representation of amounts with high dynamic range.
int exponent() const noexcept
int signum() const noexcept
Return the sign of the amount.
std::int64_t mantissa() const noexcept
A currency issued by an account.
constexpr int exponent() const noexcept
static rounding_mode getround()
static rounding_mode setround(rounding_mode mode)
constexpr rep mantissa() const noexcept
static std::uint64_t const cMaxNativeN
int exponent() const noexcept
static int const cMaxOffset
static std::uint64_t const cMaxValue
bool negative() const noexcept
std::uint64_t mantissa() const noexcept
constexpr int signum() const noexcept
Return the sign of the amount.
constexpr value_type drops() const
Returns the number of drops.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Issue const & xrpIssue()
Returns an asset specifier that represents XRP.
T toAmount(STAmount const &amt)=delete
bool isXRP(AccountID const &c)
STAmount toAmount< STAmount >(STAmount const &amt)
Issue getIssue(T const &amt)
STAmount toSTAmount(IOUAmount const &iou, Issue const &iss)
IOUAmount toAmount< IOUAmount >(STAmount const &amt)
Issue const & noIssue()
Returns an asset specifier that represents no account and currency.
T get(Section const §ion, std::string const &name, T const &defaultValue=T{})
Retrieve a key/value pair from a section.
T toMaxAmount(Issue const &issue)
XRPAmount toAmount< XRPAmount >(STAmount const &amt)