Universal Numbers Library C++ API
sw::universal -- header-only custom arithmetic types (posit, cfloat, lns, fixpnt, dd/qd, and more)
Loading...
Searching...
No Matches
sw::universal::efloat_parse_detail Namespace Reference

string parsing More...

Enumerations

enum class  parse_outcome { done , undecided , refused }

Functions

template<unsigned W, unsigned nlimbs>
constexpr parse_outcome round_into (const sw::universal::string_parse::decimal_float_scan &d, unsigned target_bits, bool inexact, efloat< nlimbs > &value)
constexpr bool is_space (char c) noexcept
constexpr char to_lower (char c) noexcept
constexpr void append_decimal (std::string &text, std::int64_t e)
template<unsigned nlimbs>
constexpr efloat< nlimbs > power_of_ten (std::uint64_t n, unsigned bits)
constexpr bool read_exponent (std::string_view s, std::int64_t &e) noexcept
template<unsigned nlimbs>
constexpr void scale_by_power_of_ten (std::string_view digits, std::int64_t exp10, bool negative, unsigned target_bits, efloat< nlimbs > &value)

Variables

constexpr unsigned guard_bits = 64u
constexpr std::int64_t exponent_limit = std::int64_t(4'000'000'000'000'000'000)

Detailed Description

string parsing

Enumeration Type Documentation

◆ parse_outcome

Enumerator
done 
undecided 
refused 

Function Documentation

◆ append_decimal()

void sw::universal::efloat_parse_detail::append_decimal ( std::string & text,
std::int64_t e )
inlineconstexpr

◆ is_space()

bool sw::universal::efloat_parse_detail::is_space ( char c)
inlineconstexprnoexcept

◆ power_of_ten()

template<unsigned nlimbs>
efloat< nlimbs > sw::universal::efloat_parse_detail::power_of_ten ( std::uint64_t n,
unsigned bits )
inlineconstexpr

◆ read_exponent()

bool sw::universal::efloat_parse_detail::read_exponent ( std::string_view s,
std::int64_t & e )
inlineconstexprnoexcept

◆ round_into()

template<unsigned W, unsigned nlimbs>
parse_outcome sw::universal::efloat_parse_detail::round_into ( const sw::universal::string_parse::decimal_float_scan & d,
unsigned target_bits,
bool inexact,
efloat< nlimbs > & value )
inlineconstexpr

◆ scale_by_power_of_ten()

template<unsigned nlimbs>
void sw::universal::efloat_parse_detail::scale_by_power_of_ten ( std::string_view digits,
std::int64_t exp10,
bool negative,
unsigned target_bits,
efloat< nlimbs > & value )
inlineconstexpr

◆ to_lower()

char sw::universal::efloat_parse_detail::to_lower ( char c)
inlineconstexprnoexcept

Variable Documentation

◆ exponent_limit

std::int64_t sw::universal::efloat_parse_detail::exponent_limit = std::int64_t(4'000'000'000'000'000'000)
constexpr

◆ guard_bits

unsigned sw::universal::efloat_parse_detail::guard_bits = 64u
constexpr