70 float y_interpolate = 0.0f;
75 slope = (y2 - y1) / (x2 - x1);
81 y_interpolate = y1 + (slope * (x_interpolate - x1));
87 return (val << 8) | (val >> 8);
91 val = ((val << 8) & 0xFF00FF00u) | ((val >> 8) & 0xFF00FFu);
92 return (val << 16) | (val >> 16);
96 val = ((val << 8) & 0xFF00FF00FF00FF00ull) | ((val >> 8) & 0x00FF00FF00FF00FFull);
97 val = ((val << 16) & 0xFFFF0000FFFF0000ull) | ((val >> 16) & 0x0000FFFF0000FFFFull);
98 return (val << 32) | (val >> 32);
102 return fminf(value1, value2);
106 return ((value1 < value2) ? value1 : value2);
110 uint16_t returnvalue = value1;
111 if (returnvalue > value2) {
112 returnvalue = value2;
118 int32_t absValue = INT32_MAX;
119 if (value != INT32_MIN) {
120 absValue = labs(value);
126 int64_t absValue = INT64_MAX;
127 if (value != INT64_MIN) {
128 absValue = llabs(value);
uint64_t MATH_swapBytes_uint64_t(uint64_t val)
Swap bytes of uint64_t value.
float MATH_MinimumOfTwoFloats(float value1, float value2)
Returns the minimum of the passed float values.
uint16_t MATH_swapBytes_uint16_t(uint16_t val)
Swap bytes of uint16_t value.
uint8_t MATH_MinimumOfTwoUint8_t(uint8_t value1, uint8_t value2)
Returns the minimum of the passed uint8_t values.
int32_t MATH_AbsInt32(int32_t value)
Returns the absolute value of passed int32_t value.
uint32_t MATH_swapBytes_uint32_t(uint32_t val)
Swap bytes of uint32_t value.
int64_t MATH_AbsInt64(int64_t value)
Returns the absolute value of passed int64_t value.
float MATH_linearInterpolation(float x1, float y1, float x2, float y2, float x_interpolate)
Linear inter-/extrapolates a third point according to two given points.
uint16_t MATH_MinimumOfTwoUint16_t(uint16_t value1, uint16_t value2)
Returns the minimum of the passed uint16_t values.
math library for often used math functions