1/* This file is part of an implementation of the "grisu3" double to string 2 conversion algorithm described in the research paper 3 4 "Printing Floating-Point Numbers Quickly And Accurately with Integers" 5 by Florian Loitsch, available at 6 http://www.cs.tufts.edu/~nr/cs257/archive/florian-loitsch/printf.pdf */ 7#pragma once 8 9extern"C" 10{ 11 12/// Converts the given double-precision floating point number to a string representation. 13/** For most inputs, this string representation is the 14 shortest such, which deserialized again, returns the same bit 15 representation of the double. 16 @param v The number to convert. 17 @param dst [out] The double-precision floating point number will be written here 18 as a null-terminated string. The conversion algorithm will write at most 25 bytes 19 to this buffer. (null terminator is included in this count). 20 The dst pointer may not be null. 21 @return the number of characters written to dst, excluding the null terminator (which 22 is always written) is returned here. */ 23intdtoa_grisu3(double v, char *dst); 24 25} 26 27#ifdef __cplusplus 28 29#include <string> 30std::string dtoa_grisu3_string(double v); 31 32#endif