max value calc fix #153

Merged
muellerr merged 3 commits from max-value-fix-v2 into develop 2023-06-20 18:20:01 +02:00
Showing only changes of commit f80c5980ea - Show all commits

View File

@ -54,7 +54,7 @@ class VectorOperations {
} }
static T maxAbsValue(const T *vector, uint8_t size, uint8_t *index = 0) { static T maxAbsValue(const T *vector, uint8_t size, uint8_t *index = 0) {
T max = -1; T max = vector[size - 1];
for (; size > 0; size--) { for (; size > 0; size--) {
T abs = vector[size - 1]; T abs = vector[size - 1];
@ -72,7 +72,7 @@ class VectorOperations {
} }
static T maxValue(const T *vector, uint8_t size, uint8_t *index = 0) { static T maxValue(const T *vector, uint8_t size, uint8_t *index = 0) {
T max = -1; T max = vector[size - 1];
for (; size > 0; size--) { for (; size > 0; size--) {
if (vector[size - 1] > max) { if (vector[size - 1] > max) {