3#include <xrpl/basics/LocalValue.h>
4#include <xrpl/basics/Number.h>
5#include <xrpl/beast/utility/Zero.h>
7#include <boost/operators.hpp>
24class IOUAmount :
private boost::totally_ordered<IOUAmount>,
private boost::additive<IOUAmount>
71 operator bool() const noexcept;
115 return Number{mantissa_, exponent_};
143inline IOUAmount::operator bool() const noexcept
145 return mantissa_ != 0;
Floating point representation of amounts with high dynamic range.
IOUAmount & operator+=(IOUAmount const &other)
mantissa_type mantissa() const noexcept
bool operator==(IOUAmount const &other) const
exponent_type exponent() const noexcept
static IOUAmount fromNumber(Number const &number)
bool operator<(IOUAmount const &other) const
IOUAmount & operator=(beast::Zero)
IOUAmount operator-() const
int signum() const noexcept
Return the sign of the amount.
static IOUAmount minPositiveAmount()
void normalize()
Adjusts the mantissa and exponent to the proper range.
IOUAmount & operator-=(IOUAmount const &other)
RAII class to set and restore the Number switchover.
NumberSO & operator=(NumberSO const &)=delete
NumberSO(NumberSO const &)=delete
Number is a floating point type that can represent a wide range of values.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::string to_string(base_uint< Bits, Tag > const &a)
void setSTNumberSwitchover(bool v)
IOUAmount mulRatio(IOUAmount const &amt, std::uint32_t num, std::uint32_t den, bool roundUp)
bool getSTNumberSwitchover()
Zero allows classes to offer efficient comparisons to zero.