Audacity 3.2.0
|
Classes | |
struct | boundaries |
struct | cached_power |
struct | diyfp |
Functions | |
template<typename Target , typename Source > | |
Target | reinterpret_bits (const Source source) |
template<typename FloatType > | |
boundaries | compute_boundaries (FloatType value) |
cached_power | get_cached_power_for_binary_exponent (int e) |
int | find_largest_pow10 (const std::uint32_t n, std::uint32_t &pow10) |
void | grisu2_round (char *buf, int len, std::uint64_t dist, std::uint64_t delta, std::uint64_t rest, std::uint64_t ten_k) |
bool | grisu2_digit_gen (char *buffer, char *last, int &length, int &decimal_exponent, diyfp M_minus, diyfp w, diyfp M_plus) |
bool | grisu2 (char *buf, char *last, int &len, int &decimal_exponent, diyfp m_minus, diyfp v, diyfp m_plus) |
template<typename FloatType > | |
bool | grisu2 (char *buf, char *last, int &len, int &decimal_exponent, FloatType value) |
ToCharsResult | append_exponent (char *buf, char *last, int e) |
appends a decimal representation of e to buf More... | |
ToCharsResult | format_buffer (char *buf, char *last, int len, int decimal_exponent, int min_exp, int max_exp) |
prettify v = buf * 10^decimal_exponent If v is in the range [10^min_exp, 10^max_exp) it will be printed in fixed-point notation. Otherwise it will be printed in exponential notation. More... | |
Variables | |
constexpr int | kAlpha = -60 |
constexpr int | kGamma = -32 |
|
inline |
appends a decimal representation of e to buf
Definition at line 1021 of file ToChars.cpp.
Referenced by format_buffer().
boundaries internal::dtoa_impl::compute_boundaries | ( | FloatType | value | ) |
Compute the (normalized) diyfp representing the input number 'value' and its boundaries.
Definition at line 316 of file ToChars.cpp.
References internal::dtoa_impl::diyfp::e, internal::dtoa_impl::diyfp::f, internal::dtoa_impl::diyfp::normalize(), and internal::dtoa_impl::diyfp::normalize_to().
Referenced by grisu2().
|
inline |
For n != 0, returns k, such that pow10 := 10^(k-1) <= n < 10^k. For n == 0, returns 1 and sets pow10 := 1.
Definition at line 577 of file ToChars.cpp.
Referenced by grisu2_digit_gen().
|
inline |
prettify v = buf * 10^decimal_exponent If v is in the range [10^min_exp, 10^max_exp) it will be printed in fixed-point notation. Otherwise it will be printed in exponential notation.
Definition at line 1076 of file ToChars.cpp.
References append_exponent().
Referenced by internal::float_to_chars().
|
inline |
For a normalized diyfp w = f * 2^e, this function returns a (normalized) cached power-of-ten c = f_c * 2^e_c, such that the exponent of the product w * c satisfies (Definition 3.2 from [1]) alpha <= e_c + e + q <= gamma.
Definition at line 459 of file ToChars.cpp.
References kAlpha.
Referenced by grisu2().
|
inline |
v = buf * 10^decimal_exponent len is the length of the buffer (number of decimal digits) The buffer must be large enough, i.e. >= max_digits10.
Definition at line 923 of file ToChars.cpp.
References internal::dtoa_impl::diyfp::e, internal::dtoa_impl::cached_power::e, internal::dtoa_impl::diyfp::f, internal::dtoa_impl::cached_power::f, get_cached_power_for_binary_exponent(), grisu2_digit_gen(), internal::dtoa_impl::cached_power::k, and internal::dtoa_impl::diyfp::mul().
Referenced by internal::float_to_chars(), and grisu2().
bool internal::dtoa_impl::grisu2 | ( | char * | buf, |
char * | last, | ||
int & | len, | ||
int & | decimal_exponent, | ||
FloatType | value | ||
) |
v = buf * 10^decimal_exponent len is the length of the buffer (number of decimal digits) The buffer must be large enough, i.e. >= max_digits10.
Definition at line 982 of file ToChars.cpp.
References compute_boundaries(), grisu2(), internal::dtoa_impl::diyfp::kPrecision, internal::dtoa_impl::boundaries::minus, internal::dtoa_impl::boundaries::plus, and internal::dtoa_impl::boundaries::w.
|
inline |
Generates V = buffer * 10^decimal_exponent, such that M- <= V <= M+. M- and M+ must be normalized and share the same exponent -60 <= e <= -32.
Definition at line 669 of file ToChars.cpp.
References internal::dtoa_impl::diyfp::e, internal::dtoa_impl::diyfp::f, find_largest_pow10(), grisu2_round(), kAlpha, kGamma, and internal::dtoa_impl::diyfp::sub().
Referenced by grisu2().
|
inline |
Definition at line 633 of file ToChars.cpp.
Referenced by grisu2_digit_gen().
Target internal::dtoa_impl::reinterpret_bits | ( | const Source | source | ) |
Definition at line 154 of file ToChars.cpp.
|
constexpr |
Definition at line 443 of file ToChars.cpp.
Referenced by get_cached_power_for_binary_exponent(), and grisu2_digit_gen().
|
constexpr |
Definition at line 444 of file ToChars.cpp.
Referenced by grisu2_digit_gen().