4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-01-19 04:49:25 +08:00
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
..
2017-12-01 03:41:53 -06:00
2018-10-10 17:49:53 +02:00
2017-12-01 03:41:53 -06:00
2017-12-01 03:41:53 -06:00
2020-03-10 15:11:23 +01:00
2017-12-01 03:41:53 -06:00
2017-12-01 03:41:53 -06:00
2017-12-01 03:41:53 -06:00
2017-12-01 03:41:53 -06:00
2018-01-17 11:47:26 -06:00
2018-01-17 11:47:26 -06:00
2017-12-01 03:41:53 -06:00
2018-01-17 11:47:26 -06:00
2017-12-01 03:41:53 -06:00
2017-12-01 03:41:53 -06:00
2017-12-01 03:41:53 -06:00
2017-12-01 03:41:53 -06:00
2017-12-01 03:41:53 -06:00
2002-06-07 21:59:57 +00:00
2017-12-01 03:41:53 -06:00
2017-12-01 03:41:53 -06:00
2019-07-09 13:06:59 -04:00
2020-03-10 15:11:23 +01:00
2018-01-17 11:47:26 -06:00
2018-01-17 11:47:26 -06:00
2018-01-17 11:47:26 -06:00
2018-01-17 11:47:26 -06:00
2002-06-07 21:59:57 +00:00
2020-03-11 12:10:58 +01:00
2016-03-26 20:29:20 +01:00
2018-08-08 10:50:19 +02:00