|
lsst.sphgeom g99f1e191f7+663e2227e0
|
This file declares a routine for formatting doubles using the shortest decimal string that round-trips. More...
#include <cstddef>#include <string>Go to the source code of this file.
Namespaces | |
| namespace | lsst::sphgeom |
Macros | |
| #define | SPHGEOM_HAVE_FP_TO_CHARS 1 |
Functions | |
| void | lsst::sphgeom::detail::appendShortestDoubleFallback (std::string &out, double value) |
| void | lsst::sphgeom::appendShortestDouble (std::string &out, double value) |
Variables | |
| constexpr std::size_t | lsst::sphgeom::MAX_SHORTEST_DOUBLE_CHARS = 24 |
| The maximum number of characters appendShortestDouble can append. | |
This file declares a routine for formatting doubles using the shortest decimal string that round-trips.
| #define SPHGEOM_HAVE_FP_TO_CHARS 1 |
SPHGEOM_HAVE_FP_TO_CHARS is 1 when the floating point std::to_chars overloads can be used, and 0 otherwise.
libc++ implements those overloads in the dylib rather than in the header, and annotates them as introduced in macOS 13.3, so they cannot be called when the deployment target is older than that. Python extensions inherit their deployment target from the interpreter they are built against, which for the PyPI wheel builds is much older than 13.3. 130300 is the value __MAC_OS_X_VERSION_MIN_REQUIRED takes for macOS 13.3; it is spelled out because the __MAC_13_3 constant is missing from older SDKs.
| void lsst::sphgeom::detail::appendShortestDoubleFallback | ( | std::string & | out, |
| double | value ) |
appendShortestDoubleFallback is the implementation of appendShortestDouble used where SPHGEOM_HAVE_FP_TO_CHARS is 0.
It is compiled unconditionally so that the unit tests exercise it, and check it against std::to_chars, on every platform. Both it and the SPHGEOM_HAVE_FP_TO_CHARS switch can be deleted once no supported build targets a macOS older than 13.3.