Hi Tom, Tom Bannink wrote,
Hi uClibc-ng developers,
I've stumbled across a bug in the implementation of `lrint` in uClibc-ng. I'm not sure where to report this so I'm sending this email. Please let me know if I can submit an issue on a bugtracker somewhere. I tried to post an issue on the gitlab page (https://gogs.waldemar-brodkorb.de/oss/uclibc-ng/issues) but it seems I cannot make an account there.
The bug is simple to reproduce: `lrint(0.5)` and `lrint(-0.5)` should return 0 (or +-1 depending on the rounding mode) but instead they return 2 and -2 respectively.
The faulty code is the block at lines 55-64 of this file: https:// cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/tree/libm/s_lrint.c Note that the `lround` function works fine and has very similar code: https:// cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/tree/libm/s_lround.c
Let me know if you need more information.
Can you provide a simple test case for the issue?
best regards Waldemar