20 #ifndef RIPPLE_BASICS_IOUAMOUNT_H_INCLUDED
21 #define RIPPLE_BASICS_IOUAMOUNT_H_INCLUDED
23 #include <ripple/basics/LocalValue.h>
24 #include <ripple/basics/Number.h>
25 #include <ripple/beast/utility/Zero.h>
26 #include <boost/operators.hpp>
43 class IOUAmount :
private boost::totally_ordered<IOUAmount>,
44 private boost::additive<IOUAmount>
85 explicit operator bool() const noexcept;
121 inline IOUAmount::operator
Number()
const
123 return Number{mantissa_, exponent_};
151 inline IOUAmount::operator bool() const noexcept
153 return mantissa_ != 0;
IOUAmount mulRatio(IOUAmount const &amt, std::uint32_t num, std::uint32_t den, bool roundUp)
int exponent() const noexcept
void setSTNumberSwitchover(bool v)
static IOUAmount minPositiveAmount()
void normalize()
Adjusts the mantissa and exponent to the proper range.
RAII class to set and restore the Number switchover.
NumberSO & operator=(NumberSO const &)=delete
Floating point representation of amounts with high dynamic range.
bool operator<(IOUAmount const &other) const
int signum() const noexcept
Return the sign of the amount.
NumberSO(NumberSO const &)=delete
IOUAmount & operator-=(IOUAmount const &other)
Zero allows classes to offer efficient comparisons to zero.
IOUAmount & operator+=(IOUAmount const &other)
bool operator==(IOUAmount const &other) const
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::int64_t mantissa() const noexcept
bool getSTNumberSwitchover()
IOUAmount operator-() const
std::string to_string(Manifest const &m)
Format the specified manifest to a string for debugging purposes.
IOUAmount & operator=(beast::Zero)