nlohmann::detail::dtoa_impl::diyfp Struct Reference

#include <json.hpp>

Public Member Functions

constexpr diyfp (std::uint64_t f_, int e_) noexcept
 

Static Public Member Functions

static diyfp mul (const diyfp &x, const diyfp &y) noexcept
 returns x * y More...
 
static diyfp normalize (diyfp x) noexcept
 normalize x such that the significand is >= 2^(q-1) More...
 
static diyfp normalize_to (const diyfp &x, const int target_exponent) noexcept
 normalize x such that the result has the exponent E More...
 
static diyfp sub (const diyfp &x, const diyfp &y) noexcept
 returns x - y More...
 

Public Attributes

int e = 0
 
std::uint64_t f = 0
 

Static Public Attributes

static constexpr int kPrecision = 64
 

Constructor & Destructor Documentation

◆ diyfp()

constexpr nlohmann::detail::dtoa_impl::diyfp::diyfp ( std::uint64_t  f_,
int  e_ 
)
constexprnoexcept

Member Function Documentation

◆ mul()

static diyfp nlohmann::detail::dtoa_impl::diyfp::mul ( const diyfp x,
const diyfp y 
)
staticnoexcept

returns x * y

Note
The result is rounded. (Only the upper q bits are returned.)

References f, and kPrecision.

Referenced by nlohmann::detail::dtoa_impl::grisu2().

◆ normalize()

static diyfp nlohmann::detail::dtoa_impl::diyfp::normalize ( diyfp  x)
staticnoexcept

◆ normalize_to()

static diyfp nlohmann::detail::dtoa_impl::diyfp::normalize_to ( const diyfp x,
const int  target_exponent 
)
staticnoexcept

normalize x such that the result has the exponent E

Precondition
e >= x.e and the upper e - x.e bits of x.f must be zero.

References e.

Referenced by nlohmann::detail::dtoa_impl::compute_boundaries().

◆ sub()

static diyfp nlohmann::detail::dtoa_impl::diyfp::sub ( const diyfp x,
const diyfp y 
)
staticnoexcept

Member Data Documentation

◆ e

◆ f

std::uint64_t nlohmann::detail::dtoa_impl::diyfp::f = 0

◆ kPrecision

constexpr int nlohmann::detail::dtoa_impl::diyfp::kPrecision = 64
staticconstexpr

The documentation for this struct was generated from the following file: