ARTS 2.5.9 (git: 825fa5f2)
arts_constexpr_math.h
Go to the documentation of this file.
1/* Copyright (C) 2019
2 * Richard Larsson <ric.larsson@gmail.com>
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2, or (at your option) any
7 * later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
17 * USA. */
18
33#ifndef CONSTANT_MATHS_IN_ARTS_H
34#define CONSTANT_MATHS_IN_ARTS_H
35
37namespace Math {
39constexpr auto pow2(auto x) noexcept { return x * x; }
40
42constexpr auto pow3(auto x) noexcept { return pow2(x) * x; }
43
45constexpr auto pow4(auto x) noexcept { return pow2(pow2(x)); }
46} // namespace Math
47
48#endif
Namespace containing several constants, physical and mathematical.
constexpr auto pow3(auto x) noexcept
power of three
constexpr auto pow4(auto x) noexcept
power of four
constexpr auto pow2(auto x) noexcept
power of two