newlib-cygwin/newlib/libm
Jesse Huang via Newlib 9e329b544a Fix rounding results in lrint() & llrint() when close to 0
soft-fp should round floating pointer numbers according to the current
rounding mode. However, in the current code of lrint() and llrint(),
there are if statements before the actual rounding computation

      if(j0 < -1)
        return 0;

Where j0 is the exponent of the floating point number.

It means any number having a exponent less than -1
(i.e. interval (-0.5, 0.5)) will be rounded to 0 regardeless of the
rounding mode.

The bug already fixed in glibc in 2006 by moving the check afterwards
the rounding computation, but still persists in newlib.

This patch fixed it in a similar way to glibc
Ref Commit in glibc: 6624dbc07b5a9fb316ed188ef01f65b8eea8b47c
2023-07-27 11:14:12 +02:00
..
common Fix rounding results in lrint() & llrint() when close to 0 2023-07-27 11:14:12 +02:00
complex newlib: libm: merge build up a directory 2022-02-17 20:56:32 -05:00
fenv newlib: libm: merge build up a directory 2022-02-17 20:56:32 -05:00
ld newlib: Add non LDBL_EQ_DBL math support for aarch64, i386, and x86_64 2023-05-16 09:05:36 -05:00
ld80 newlib: Add non LDBL_EQ_DBL math support for aarch64, i386, and x86_64 2023-05-16 09:05:36 -05:00
ld128 newlib: Add non LDBL_EQ_DBL math support for aarch64, i386, and x86_64 2023-05-16 09:05:36 -05:00
machine RISC-V: Support Zfinx/Zdinx extension. 2023-07-26 15:21:35 +02:00
math Move signgm.c from libc/reent to libm/math 2023-05-05 14:49:48 -04:00
mathfp newlib: libm: merge build up a directory 2022-02-17 20:56:32 -05:00
test newlib: libm: integrate tests subdir 2022-03-16 22:01:19 -04:00
Makefile.inc newlib: Add non LDBL_EQ_DBL math support for aarch64, i386, and x86_64 2023-05-16 09:05:36 -05:00
acinclude.m4 amdgcn: Add vectorized math routines 2023-01-18 13:22:58 -05:00
libm.in.xml fenv: Include documentation in generated .info file 2019-08-15 12:04:50 +02:00
libm.texi Bump newlib version in the manual to 4.3.0 2023-03-30 14:09:30 +02:00