Universal Numbers Library C++ API
sw::universal -- header-only custom arithmetic types (posit, cfloat, lns, fixpnt, dd/qd, and more)
Loading...
Searching...
No Matches
efloat_constant.hpp File Reference
#include <array>
#include <cstddef>
#include <cstdint>
#include <limits>
#include <type_traits>
#include <universal/number/efloat/efloat_impl.hpp>

Classes

class  sw::universal::efloat_constant< nlimbs >

Namespaces

namespace  sw
 required std libraries
namespace  sw::universal

Macros

#define EFLOAT_CONSTANT_COMPARISON(op)
#define EFLOAT_CONSTANT_ARITHMETIC(op)

Macro Definition Documentation

◆ EFLOAT_CONSTANT_ARITHMETIC

#define EFLOAT_CONSTANT_ARITHMETIC ( op)
Value:
friend constexpr value_type operator op(const efloat_constant& a, const efloat_constant& b) { return a.value() op b.value(); } \
friend constexpr value_type operator op(const efloat_constant& a, const value_type& b) { return a.value() op b; } \
friend constexpr value_type operator op(const value_type& a, const efloat_constant& b) { return a op b.value(); } \
template<typename Native, typename = std::enable_if_t<std::is_arithmetic_v<Native>>> \
friend constexpr value_type operator op(const efloat_constant& a, Native b) { return a.value() op native(b); } \
template<typename Native, typename = std::enable_if_t<std::is_arithmetic_v<Native>>> \
friend constexpr value_type operator op(Native a, const efloat_constant& b) { return native(a) op b.value(); }
typename value_type_trait< _Ty >::type value_type
Definition integral_constant.hpp:35

◆ EFLOAT_CONSTANT_COMPARISON

#define EFLOAT_CONSTANT_COMPARISON ( op)
Value:
friend constexpr bool operator op(const efloat_constant& a, const efloat_constant& b) { return a.value() op b.value(); } \
friend constexpr bool operator op(const efloat_constant& a, const value_type& b) { return a.value() op b; } \
friend constexpr bool operator op(const value_type& a, const efloat_constant& b) { return a op b.value(); } \
template<typename Native, typename = std::enable_if_t<std::is_arithmetic_v<Native>>> \
friend constexpr bool operator op(const efloat_constant& a, Native b) { return a.value() op native(b); } \
template<typename Native, typename = std::enable_if_t<std::is_arithmetic_v<Native>>> \
friend constexpr bool operator op(Native a, const efloat_constant& b) { return native(a) op b.value(); }