mirror of
https://github.com/orange-cpp/omath.git
synced 2026-06-11 17:54:35 +00:00
added gcem
This commit is contained in:
@@ -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
|
||||
@@ -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]]
|
||||
|
||||
Reference in New Issue
Block a user