lsst.sphgeom g65ec699a40+663e2227e0
Loading...
Searching...
No Matches
floatFormat.h
Go to the documentation of this file.
1/*
2 * This file is part of sphgeom.
3 *
4 * Developed for the LSST Data Management System.
5 * This product includes software developed by the LSST Project
6 * (http://www.lsst.org).
7 * See the COPYRIGHT file at the top-level directory of this distribution
8 * for details of code ownership.
9 *
10 * This software is dual licensed under the GNU General Public License and also
11 * under a 3-clause BSD license. Recipients may choose which of these licenses
12 * to use; please see the files gpl-3.0.txt and/or bsd_license.txt,
13 * respectively. If you choose the GPL option then the following text applies
14 * (but note that there is still no warranty even if you opt for BSD instead):
15 *
16 * This program is free software: you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation, either version 3 of the License, or
19 * (at your option) any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program. If not, see <http://www.gnu.org/licenses/>.
28 */
29
30#ifndef LSST_SPHGEOM_FLOATFORMAT_H_
31#define LSST_SPHGEOM_FLOATFORMAT_H_
32
36
37#include <cstddef>
38#include <string>
39
40#if defined(__APPLE__)
41#include <Availability.h>
42#endif
43
54#if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < 130300
55#define SPHGEOM_HAVE_FP_TO_CHARS 0
56#else
57#define SPHGEOM_HAVE_FP_TO_CHARS 1
58#endif
59
60namespace lsst {
61namespace sphgeom {
62
64constexpr std::size_t MAX_SHORTEST_DOUBLE_CHARS = 24;
65
66namespace detail {
67
75void appendShortestDoubleFallback(std::string & out, double value);
76
77} // namespace detail
78
87void appendShortestDouble(std::string & out, double value);
88
89}} // namespace lsst::sphgeom
90
91#endif // LSST_SPHGEOM_FLOATFORMAT_H_
constexpr std::size_t MAX_SHORTEST_DOUBLE_CHARS
The maximum number of characters appendShortestDouble can append.
Definition floatFormat.h:64
void appendShortestDouble(std::string &out, double value)
Definition floatFormat.cc:173