src/math.h

Sat, 14 Dec 2019 22:36:06 +0200

author
Teemu Piippo <teemu@hecknology.net>
date
Sat, 14 Dec 2019 22:36:06 +0200
changeset 19
ed9685f44ab3
parent 18
918b6c0f8b5b
permissions
-rw-r--r--

added missing files

#pragma once
#include <cmath>

namespace math
{
	using std::abs;
	using std::sqrt;
	using std::sin;
	using std::cos;
	using std::tan;
	using std::atan;
	using std::atan2;
	using std::acos;
	using std::asin;
	using std::exp;
	using std::log;
	using std::log10;
	using std::hypot;
	using std::min;
	using std::max;
	using std::floor;
	using std::ceil;
	using std::trunc;
	using std::round;
	template<typename T, typename... Rest>
	auto hypot(T&& x, Rest&&... rest)
	{
		return math::hypot(x, math::hypot(rest...));
	}
	template<typename T, typename... Rest>
	auto max(T&& x, Rest&&... rest)
	{
		return math::max(x, math::max(rest...));
	}
	template<typename T, typename... Rest>
	auto min(T&& x, Rest&&... rest)
	{
		return math::min(x, math::min(rest...));
	}
	constexpr double infinity = std::numeric_limits<double>::infinity();
	constexpr double pi = M_PIl;
}

mercurial