CoriEngine
Loading...
Searching...
No Matches
Sign.hpp
Go to the documentation of this file.
1#pragma once
2
3namespace Cori {
7 namespace Math {
13 template <typename T>
14 int32_t Sign(T val) {
15 if constexpr (std::is_unsigned_v<T>) {
16 return T(0) < val;
17 }
18 else {
19 return (T(0) < val) - (val < T(0));
20 }
21 }
22 }
23}
Anything custom connected to math is in this namespace.
Definition Function.hpp:5
int32_t Sign(T val)
Returns a sign of a number.
Definition Sign.hpp:14
Global engine namespace.