1#ifndef OSMIUM_UTIL_DOUBLE_HPP
2#define OSMIUM_UTIL_DOUBLE_HPP
44 inline namespace util {
57 assert(precision <= 17);
60 max_double_length = 20
63 char buffer[max_double_length];
66 int len = snprintf(buffer, max_double_length,
"%.*f", precision, value);
68 int len = _snprintf(buffer, max_double_length,
"%.*f", precision, value);
70 assert(len > 0 && len < max_double_length);
72 while (buffer[len - 1] ==
'0') {
75 if (buffer[len - 1] ==
'.') {
79 return std::copy_n(buffer, len, iterator);
90 inline void double2string(std::string& out,
double value,
int precision) {
T double2string(T iterator, double value, int precision)
Definition: double.hpp:56
Namespace for everything in the Osmium library.
Definition: assembler.hpp:53