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