File size: 609 Bytes
1ce325b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef UTIL_FLOAT_TO_STRING_H
#define UTIL_FLOAT_TO_STRING_H

// Just for ToStringBuf
#include "integer_to_string.hh"

namespace util {

template <> struct ToStringBuf<double> {
  // DoubleToStringConverter::kBase10MaximalLength + 1 for null paranoia.
  static const unsigned kBytes = 19;
};

// Single wasn't documented in double conversion, so be conservative and
// say the same as double.
template <> struct ToStringBuf<float> {
  static const unsigned kBytes = 19;
};

char *ToString(double value, char *to);
char *ToString(float value, char *to);

} // namespace util

#endif // UTIL_FLOAT_TO_STRING_H