patch: split fp_to_string.h into fptostring.h and fptostring.cpp

This commit is contained in:
Simon Gene Gottlieb
2024-07-29 18:14:02 +02:00
committed by Jesse Beder
parent 28c0a1bc25
commit 5d9e4b6251
5 changed files with 33 additions and 11 deletions

View File

@@ -0,0 +1,22 @@
// SPDX-FileCopyrightText: 2024 Simon Gene Gottlieb
// SPDX-License-Identifier: MIT
#ifndef YAML_H_FP_TO_STRING
#define YAML_H_FP_TO_STRING
#include "contrib/dragonbox.h"
#include <array>
#include <cassert>
#include <cmath>
#include <sstream>
#include <tuple>
namespace YAML {
// "precision = 0" refers to shortest known unique representation of the value
std::string FpToString(float v, size_t precision = 0);
std::string FpToString(double v, size_t precision = 0);
std::string FpToString(long double v, size_t precision = 0);
}
#endif