9#if defined(_WIN32) && defined(_MSC_VER)
23 static constexpr float E { 2.718281828459045f };
24 static constexpr float PI { 3.141592653589793f };
25 static constexpr float EPSILON { 0.0000001f };
26 static constexpr float DEG2RAD { 0.017453294f };
27 static constexpr float g { 9.80665f };
37 if (value <
min)
return min;
38 if (value >
max)
return max;
49 inline static int64_t
clamp(int64_t value, int64_t
min, int64_t
max) {
50 if (value <
min)
return min;
51 if (value >
max)
return max;
62 inline static float clamp(
float value,
float min,
float max) {
63 if (value <
min)
return min;
64 if (value >
max)
return max;
73 inline static float sign(
float value) {
82 inline static float square(
float value) {
91 inline static int32_t
abs(int32_t value) {
92 return std::abs(value);
100 inline static int64_t
abs(int64_t value) {
101 return std::abs(value);
109 inline static float abs(
float value) {
110 return std::fabs(value);
118 inline static float acos(
float value) {
119 return std::acos(value);
127 inline static float asin(
float value) {
128 return std::asin(value);
136 inline static float atan(
float value) {
137 return std::atan(value);
147 inline static float atan2(
float y,
float x) {
148 return std::atan2(y, x);
156 inline static float ceil(
float value) {
157 return std::ceil(value);
165 inline static float cos(
float value) {
166 return std::cos(value);
174 inline static float floor(
float value) {
175 return std::floor(value);
184 inline static int32_t
max(int32_t value1, int32_t value2) {
185 return value1 > value2?value1:value2;
194 inline static int64_t
max(int64_t value1, int64_t value2) {
195 return value1 > value2?value1:value2;
204 inline static float max(
float value1,
float value2) {
205 return value1 > value2?value1:value2;
214 inline static int32_t
min(int32_t value1, int32_t value2) {
215 return value1 < value2?value1:value2;
224 inline static int32_t
min(int64_t value1, int64_t value2) {
225 return value1 < value2?value1:value2;
234 inline static float min(
float value1,
float value2) {
235 return value1 < value2?value1:value2;
243 inline static float round(
float value) {
244 return std::round(value);
253 inline static int32_t
pow(int32_t value1, int32_t value2) {
254 return std::pow(value1, value2);
263 inline static float pow(
float value1,
float value2) {
264 return std::pow(value1, value2);
272 return (
float)rand() / (float)RAND_MAX;
280 inline static float sin(
float value) {
281 return std::sin(value);
289 inline static float sqrt(
float value) {
290 return std::sqrt(value);
298 inline static float tan(
float value) {
299 return std::tan(value);
307 inline static float exp(
float value) {
308 return std::exp(value);
316 inline static float log(
float value) {
317 return std::log(value);
326 inline static float mod(
float value,
float range) {
327 return std::fmod(value, range);
336 inline static float absmod(
float value,
float range) {
337 while (value < 0.0f) value+= range;
338 return std::fmod(value, range);
static int32_t max(int32_t value1, int32_t value2)
Returns the higher value of given values.
static float sqrt(float value)
Returns the square of given value.
static float log(float value)
Returns the natural (base e) logarithm of value.
static float max(float value1, float value2)
Returns the higher value of given values.
static float round(float value)
Returns the rounded value of given float value.
static int clamp(int value, int min, int max)
Clamps a int value to min or max value.
static float tan(float value)
Returns the tangent of an angle.
static int64_t max(int64_t value1, int64_t value2)
Returns the higher value of given values.
static float square(float value)
Do the square product.
static float acos(float value)
Returns the arc cosine of a value.
static float cos(float value)
Returns the cosine of an angle.
static float min(float value1, float value2)
Returns the lesser value of given values.
static float clamp(float value, float min, float max)
Clamps a float value to min or max value.
static int64_t abs(int64_t value)
Returns absolute value.
static float floor(float value)
Returns the lower integer value of given value.
static float asin(float value)
Returns the arc sine of a value.
static constexpr float EPSILON
static int32_t pow(int32_t value1, int32_t value2)
Returns the value of the value 1 raised to the power of value2.
static float abs(float value)
Returns absolute value.
static float sign(float value)
Returns sign of value.
static float random()
Returns a random value between 0.0 .
static int64_t clamp(int64_t value, int64_t min, int64_t max)
Clamps a 64 bit int value to min or max value.
static float exp(float value)
Returns e raised to the given power.
static int32_t abs(int32_t value)
Returns absolute value.
static int32_t min(int64_t value1, int64_t value2)
Returns the lesser value of given values.
static float atan(float value)
Returns the arc tangent of a value.
static float absmod(float value, float range)
Returns absolute modulo of value, so that return value is 0.0f <= value < range.
static float atan2(float y, float x)
Returns the angle from the conversion of rectangular coordinates to polar coordinates.
static int32_t min(int32_t value1, int32_t value2)
Returns the lesser value of given values.
static constexpr float PI
static float pow(float value1, float value2)
Returns the value of the value 1 raised to the power of value2.
static float mod(float value, float range)
Returns modulo of value, so that return value is -range < value < range.
static float ceil(float value)
Returns the higher integer value of given value.
static constexpr float DEG2RAD
static float sin(float value)
Returns the sine of an angle.