![]() |
Audacity 3.2.0
|
#include "ToChars.h"
#include <array>
#include <cmath>
#include <cstdint>
#include <cstring>
#include <numeric>
Go to the source code of this file.
Classes | |
struct | internal::itoa_impl::pair |
struct | internal::dtoa_impl::diyfp |
struct | internal::dtoa_impl::boundaries |
struct | internal::dtoa_impl::cached_power |
Namespaces | |
namespace | internal |
namespace | internal::itoa_impl |
namespace | internal::dtoa_impl |
Macros | |
#define | P(T) T, '0', T, '1', T, '2', T, '3', T, '4', T, '5', T, '6', T, '7', T, '8', T, '9' |
#define | W(N, I) *(pair*)&b[N] = s_pairs[I] |
#define | A(N) t = (uint64_t(1) << (32 + N / 5 * N * 53 / 16)) / uint32_t(1e##N) + 1 + N / 6 - N / 8, t *= u, t >>= N / 5 * N * 53 / 16, t += N / 6 * 4, W(0, t >> 32) |
#define | S(N) b[N] = char(uint64_t(10) * uint32_t(t) >> 32) + '0' |
#define | D(N) t = uint64_t(100) * uint32_t(t), W(N, t >> 32) |
#define | L0 b[0] = char(u) + '0' |
#define | L1 W(0, u) |
#define | L2 A(1), S(2) |
#define | L3 A(2), D(2) |
#define | L4 A(3), D(2), S(4) |
#define | L5 A(4), D(2), D(4) |
#define | L6 A(5), D(2), D(4), S(6) |
#define | L7 A(6), D(2), D(4), D(6) |
#define | L8 A(7), D(2), D(4), D(6), S(8) |
#define | L9 A(8), D(2), D(4), D(6), D(8) |
#define | LN(N) (L##N, b += N + 1) |
#define | LZ LN |
#define | LG(F) |
Functions | |
char * | internal::itoa_impl::u64toa_jeaiii (uint64_t n, char *b) |
template<typename Target , typename Source > | |
Target | internal::dtoa_impl::reinterpret_bits (const Source source) |
template<typename FloatType > | |
boundaries | internal::dtoa_impl::compute_boundaries (FloatType value) |
cached_power | internal::dtoa_impl::get_cached_power_for_binary_exponent (int e) |
int | internal::dtoa_impl::find_largest_pow10 (const std::uint32_t n, std::uint32_t &pow10) |
void | internal::dtoa_impl::grisu2_round (char *buf, int len, std::uint64_t dist, std::uint64_t delta, std::uint64_t rest, std::uint64_t ten_k) |
bool | internal::dtoa_impl::grisu2_digit_gen (char *buffer, char *last, int &length, int &decimal_exponent, diyfp M_minus, diyfp w, diyfp M_plus) |
bool | internal::dtoa_impl::grisu2 (char *buf, char *last, int &len, int &decimal_exponent, diyfp m_minus, diyfp v, diyfp m_plus) |
template<typename FloatType > | |
bool | internal::dtoa_impl::grisu2 (char *buf, char *last, int &len, int &decimal_exponent, FloatType value) |
ToCharsResult | internal::dtoa_impl::append_exponent (char *buf, char *last, int e) |
appends a decimal representation of e to buf More... | |
ToCharsResult | internal::dtoa_impl::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... | |
template<typename T > | |
ToCharsResult | internal::float_to_chars (char *first, char *last, T value, int digitsAfterDecimalPoint) |
STRING_UTILS_API ToCharsResult | ToChars (char *buffer, char *last, float value, int digitsAfterDecimalPoint) noexcept |
Convert a single precision floating point number to a string, always uses the dot as decimal. More... | |
STRING_UTILS_API ToCharsResult | ToChars (char *buffer, char *last, double value, int digitsAfterDecimalPoint) noexcept |
Convert a double precision floating point number to a string, always uses the dot as decimal. More... | |
ToCharsResult | ToChars (char *buffer, char *last, long long value) noexcept |
Convert a signed 64 bit integer value to string. More... | |
ToCharsResult | ToChars (char *buffer, char *last, unsigned long long value) noexcept |
Convert a unsigned 64 bit integer value to string. More... | |
Variables | |
static const pair | internal::itoa_impl::s_pairs [] = { P('0'), P('1'), P('2'), P('3'), P('4'), P('5'), P('6'), P('7'), P('8'), P('9') } |
constexpr int | internal::dtoa_impl::kAlpha = -60 |
constexpr int | internal::dtoa_impl::kGamma = -32 |
#define A | ( | N | ) | t = (uint64_t(1) << (32 + N / 5 * N * 53 / 16)) / uint32_t(1e##N) + 1 + N / 6 - N / 8, t *= u, t >>= N / 5 * N * 53 / 16, t += N / 6 * 4, W(0, t >> 32) |
Definition at line 62 of file ToChars.cpp.
#define D | ( | N | ) | t = uint64_t(100) * uint32_t(t), W(N, t >> 32) |
Definition at line 66 of file ToChars.cpp.
#define L0 b[0] = char(u) + '0' |
Definition at line 68 of file ToChars.cpp.
#define L1 W(0, u) |
Definition at line 69 of file ToChars.cpp.
Definition at line 70 of file ToChars.cpp.
Definition at line 71 of file ToChars.cpp.
Definition at line 72 of file ToChars.cpp.
Definition at line 73 of file ToChars.cpp.
#define LG | ( | F | ) |
Definition at line 84 of file ToChars.cpp.
#define LN | ( | N | ) | (L##N, b += N + 1) |
Definition at line 79 of file ToChars.cpp.
#define LZ LN |
Definition at line 80 of file ToChars.cpp.
#define P | ( | T | ) | T, '0', T, '1', T, '2', T, '3', T, '4', T, '5', T, '6', T, '7', T, '8', T, '9' |
Definition at line 56 of file ToChars.cpp.
#define S | ( | N | ) | b[N] = char(uint64_t(10) * uint32_t(t) >> 32) + '0' |
Definition at line 64 of file ToChars.cpp.
#define W | ( | N, | |
I | |||
) | *(pair*)&b[N] = s_pairs[I] |
Definition at line 60 of file ToChars.cpp.
|
noexcept |
Convert a double precision floating point number to a string, always uses the dot as decimal.
Definition at line 1233 of file ToChars.cpp.
References internal::float_to_chars().
|
noexcept |
Convert a single precision floating point number to a string, always uses the dot as decimal.
Definition at line 1225 of file ToChars.cpp.
References internal::float_to_chars().
Referenced by ToChars(), and XMLUtf8BufferWriter::WriteAttr().
|
noexcept |
Convert a signed 64 bit integer value to string.
Definition at line 1242 of file ToChars.cpp.
References ToChars().
|
noexcept |
Convert a unsigned 64 bit integer value to string.
Definition at line 1256 of file ToChars.cpp.
References staffpad::vo::copy(), and internal::itoa_impl::u64toa_jeaiii().