File indexing completed on 2024-05-12 04:44:33
0001 // SPDX-FileCopyrightText: Lukas Sommer <sommerluk@gmail.com> 0002 // SPDX-License-Identifier: BSD-2-Clause OR MIT 0003 0004 #ifndef HELPERPOSIXMATH_H 0005 #define HELPERPOSIXMATH_H 0006 0007 #include <qmath.h> 0008 0009 /** @internal 0010 * 0011 * @file 0012 * 0013 * From <tt><qmath.h></tt> documentation: 0014 * 0015 * > The header also ensures some constants specified in POSIX, but not 0016 * > present in C++ standards (so absent from <tt><math.h></tt> on some 0017 * > platforms), are defined: 0018 * 0019 * To ensure that we never forget to include <tt><qmath.h></tt>, we 0020 * define our own constexpr with these values here. When these constexpr are 0021 * used, it is ensured that <em>this</em> header is included, and thus 0022 * indirectly also <tt><qmath.h></tt>. Furthermore, the constexpr are 0023 * much more convenient to use than the POSIX constants, which are macros. */ 0024 0025 namespace PerceptualColor 0026 { 0027 0028 /** @internal 0029 * 0030 * @brief pi */ 0031 constexpr auto pi = M_PI; 0032 0033 } // namespace PerceptualColor 0034 0035 #endif // HELPERPOSIXMATH_H