mosesdecoder/util/float_to_string.hh
Kenneth Heafield a70d37e46f KenLM 7408730be415db9b650560a8b2bd3e4e3af49ec9.
unistd.hh is dead.
2015-05-19 15:27:30 -04:00

26 lines
614 B
C++

#ifndef UTIL_FLOAT_TO_STRING_H
#define UTIL_FLOAT_TO_STRING_H
// Just for ToStringBuf
#include "util/integer_to_string.hh"
namespace util {
template <> struct ToStringBuf<double> {
// DoubleToStringConverter::kBase10MaximalLength + 1 for null paranoia.
static const unsigned kBytes = 18;
};
// Single wasn't documented in double conversion, so be conservative and
// say the same as double.
template <> struct ToStringBuf<float> {
static const unsigned kBytes = 18;
};
char *ToString(double value, char *to);
char *ToString(float value, char *to);
} // namespace util
#endif // UTIL_FLOAT_TO_STRING_H