implements the Grisu2 algorithm for binary to decimal floating-point conversion.
More...
|
JSON_HEDLEY_RETURNS_NON_NULL char * | append_exponent (char *buf, int e) |
| appends a decimal representation of e to buf More...
|
|
template<typename FloatType > |
boundaries | compute_boundaries (FloatType value) |
|
int | find_largest_pow10 (const std::uint32_t n, std::uint32_t &pow10) |
|
JSON_HEDLEY_RETURNS_NON_NULL char * | format_buffer (char *buf, int len, int decimal_exponent, int min_exp, int max_exp) |
| prettify v = buf * 10^decimal_exponent More...
|
|
cached_power | get_cached_power_for_binary_exponent (int e) |
|
void | grisu2 (char *buf, int &len, int &decimal_exponent, diyfp m_minus, diyfp v, diyfp m_plus) |
|
template<typename FloatType > |
void | grisu2 (char *buf, int &len, int &decimal_exponent, FloatType value) |
|
void | grisu2_digit_gen (char *buffer, int &length, int &decimal_exponent, diyfp M_minus, diyfp w, diyfp M_plus) |
|
void | grisu2_round (char *buf, int len, std::uint64_t dist, std::uint64_t delta, std::uint64_t rest, std::uint64_t ten_k) |
|
template<typename Target , typename Source > |
Target | reinterpret_bits (const Source source) |
|
implements the Grisu2 algorithm for binary to decimal floating-point conversion.
This implementation is a slightly modified version of the reference implementation which may be obtained from http://florian.loitsch.com/publications (bench.tar.gz).
The code is distributed under the MIT license, Copyright (c) 2009 Florian Loitsch.
For a detailed description of the algorithm see:
[1] Loitsch, "Printing Floating-Point Numbers Quickly and Accurately with
Integers", Proceedings of the ACM SIGPLAN 2010 Conference on Programming Language Design and Implementation, PLDI 2010 [2] Burger, Dybvig, "Printing Floating-Point Numbers Quickly and Accurately", Proceedings of the ACM SIGPLAN 1996 Conference on Programming Language Design and Implementation, PLDI 1996