zscilib icon indicating copy to clipboard operation
zscilib copied to clipboard

vectors: if statement always true

Open ruehlchris opened this issue 1 year ago • 0 comments

https://github.com/zephyrproject-rtos/zscilib/blob/0035be5e6a45e4ab89755b176d305d7a877fc79c/src/vectors.c#L487

The if statement will return always true if (x>=1E-5 || x<=1E-5) and as no logical effect

the correct code might be: if (v->data[j] >= 1E-5 || v->data[j] <= -1E-5) to ensure v->data[j] is not smaller then the epsilon range.

ruehlchris avatar Jan 25 '23 03:01 ruehlchris