Download tools/mosesdecoder/util/float_to_string.cc from Quagmire1/wiki-cased: direct link, hf CLI and curl.
- Browser
- Download file 744 Bytes
-
https://huggingface.co/Quagmire1/wiki-cased/resolve/main/tools/mosesdecoder/util/float_to_string.cc
- Command line
-
hf download hf://Quagmire1/wiki-cased/tools/mosesdecoder/util/float_to_string.cc
-
curl -L -o float_to_string.cc https://huggingface.co/Quagmire1/wiki-cased/resolve/main/tools/mosesdecoder/util/float_to_string.cc
744 Bytes
| namespace util { | |
| namespace { | |
| const double_conversion::DoubleToStringConverter kConverter(double_conversion::DoubleToStringConverter::NO_FLAGS, "inf", "NaN", 'e', -6, 21, 6, 0); | |
| } // namespace | |
| char *ToString(double value, char *to) { | |
| double_conversion::StringBuilder builder(to, ToStringBuf<double>::kBytes); | |
| kConverter.ToShortest(value, &builder); | |
| return &to[builder.position()]; | |
| } | |
| char *ToString(float value, char *to) { | |
| double_conversion::StringBuilder builder(to, ToStringBuf<float>::kBytes); | |
| kConverter.ToShortestSingle(value, &builder); | |
| return &to[builder.position()]; | |
| } | |
| } // namespace util | |