nlp80 / irFFB

iRacing force feedback utility
155 stars 79 forks source link

Possible bug in function csignf #7

Closed kabunkie closed 7 years ago

kabunkie commented 7 years ago

I just browsed the code a bit and found something strange in the implementation of csignf... if this should basically do 'sign(b) * fabs(a)' then the line ma = _mm_andnot_ps(ma, mm); should probably read ma = _mm_andnot_ps(mm, ma), as _mm_andnot_ps(m128 a , m128 b ) is doing "~a & b" and not "a & ~b". In this current implementation it looks to me as if the function will always return either +0 or -0.

nlp80 commented 7 years ago

Nice spot! Fixed in 00cddc9. Thanks!