CoriEngine
Loading...
Searching...
No Matches
Sign.hpp
Go to the documentation of this file.
1
#pragma once
2
3
namespace
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
}
Cori::Math
Anything custom connected to math is in this namespace.
Definition
Function.hpp:5
Cori::Math::Sign
int32_t Sign(T val)
Returns a sign of a number.
Definition
Sign.hpp:14
Cori
Global engine namespace.
Definition
AssetLoadStatus.hpp:3
CoriEngine
Engine
src
Math
Sign.hpp
Generated by
1.14.0