There's an issue in volk_32f_s32f_convert_32i.
The intended logic is:
- scale the input float value by scalar
- clamp float value to 32bit integer range [-2147483648, 2147483647], or [-2147483648, 2147483648)
- Convert to int.
Unfortunately, the operation:
float value = 2147483648.0f - 1.0f;
does not result in 2147483647.0f, but 2147483648.0f since the next lower float representable number is 2147483520.0f. Thus,
int32_t result = (int32_t) 2147483648.0f - 1.0f;
results in -2147483648, aka overflow.
It may be possible to clamp the float value to 2147483520.0f but a number such as 6167483520.0f would then result in 2147483520 instead of 2147483647 which would've been the expected value.
There's an issue in
volk_32f_s32f_convert_32i.The intended logic is:
Unfortunately, the operation:
does not result in
2147483647.0f, but2147483648.0fsince the next lower float representable number is2147483520.0f. Thus,results in
-2147483648, aka overflow.It may be possible to clamp the float value to
2147483520.0fbut a number such as6167483520.0fwould then result in2147483520instead of2147483647which would've been the expected value.