Ark Server API (ASA) - Wiki
|
implements the Grisu2 algorithm for binary to decimal floating-point conversion. More...
Classes | |
struct | boundaries |
struct | cached_power |
struct | diyfp |
Variables | |
constexpr int | kAlpha = -60 |
constexpr int | kGamma = -32 |
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
|
inline |
boundaries nlohmann::detail::dtoa_impl::compute_boundaries | ( | FloatType | value | ) |
|
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 16198 of file json.hpp.
|
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 15546 of file json.hpp.