This also copy-pastes all of the math headers I originally wrote in saturn-examples.
29 lines
463 B
C++
29 lines
463 B
C++
#pragma once
|
|
|
|
template <typename T>
|
|
constexpr T sqrt(const T n) noexcept;
|
|
|
|
template <>
|
|
constexpr float sqrt(const float n) noexcept
|
|
{
|
|
return __builtin_sqrtf(n);
|
|
}
|
|
|
|
template <typename T>
|
|
constexpr T cos(const T n) noexcept;
|
|
|
|
template <>
|
|
constexpr float cos(const float n) noexcept
|
|
{
|
|
return __builtin_cosf(n);
|
|
}
|
|
|
|
template <typename T>
|
|
constexpr T sin(const T n) noexcept;
|
|
|
|
template <>
|
|
constexpr float sin(const float n) noexcept
|
|
{
|
|
return __builtin_sinf(n);
|
|
}
|