added gcem

This commit is contained in:
2026-06-11 16:18:42 +03:00
parent 5d9dbec5b8
commit 00e7c564fd
5 changed files with 49 additions and 4 deletions
@@ -0,0 +1,12 @@
//
// Created by orange on 6/11/2026.
//
#pragma once
#ifdef OMATH_USE_GCEM
#include <gcem.hpp>
#define OMATH_CONSTEXPR constexpr
#else
#define OMATH_CONSTEXPR
#endif
+19 -3
View File
@@ -7,6 +7,7 @@
#include <algorithm>
#include <format>
#include <utility>
#include "omath/internal/optional_constexpr_math.hpp"
namespace omath
{
@@ -70,21 +71,36 @@ namespace omath
}
[[nodiscard]]
Type sin() const noexcept
OMATH_CONSTEXPR Type sin() const noexcept
{
#ifdef OMATH_USE_GCEM
return gcem::sin(as_radians());
#else
return std::sin(as_radians());
#endif
}
[[nodiscard]]
Type cos() const noexcept
OMATH_CONSTEXPR Type cos() const noexcept
{
#ifdef OMATH_USE_GCEM
return gcem::cos(as_radians());
#else
return std::cos(as_radians());
#endif
}
[[nodiscard]]
Type tan() const noexcept
OMATH_CONSTEXPR Type tan() const noexcept
{
#ifdef OMATH_USE_GCEM
return gcem::tan(as_radians());
#else
return std::tan(as_radians());
#endif
}
[[nodiscard]]