FastLED 3.9.15
Loading...
Searching...
No Matches

◆ compare_f32_arrays()

bool simd_test::compare_f32_arrays ( const float * a,
const float * b,
size_t count,
float epsilon = 0.001f )

Compare two float arrays element-wise with epsilon tolerance.

Parameters
aFirst array
bSecond array
countNumber of elements to compare
epsilonMaximum allowed difference between elements
Returns
true if arrays match within epsilon, false otherwise

Definition at line 23 of file test_helpers.cpp.

23 {
24 for (size_t i = 0; i < count; i++) {
25 float diff = a[i] - b[i];
26 if (diff < 0.0f) diff = -diff;
27 if (diff > epsilon) {
28 return false;
29 }
30 }
31 return true;
32}

Referenced by test_add_f32_4(), test_div_f32_4(), test_load_store_f32_4(), test_max_f32_4(), test_min_f32_4(), test_mul_f32_4(), test_set1_f32_4(), test_sqrt_f32_4(), and test_sub_f32_4().

+ Here is the caller graph for this function: