Skip to content

Commit

Permalink
fix llrint and lrint for 52 <= exponent <= 62
Browse files Browse the repository at this point in the history
  • Loading branch information
mkannwischer authored and kito-cheng committed Jun 5, 2018
1 parent af5af06 commit c0372b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions newlib/libm/common/s_llrint.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ long long int
if (j0 >= 52)
/* 64bit return: j0 in [52,62] */
/* 64bit return: left shift amt in [32,42] */
result = ((long long int) ((i0 & 0x000fffff) | 0x0010000) << (j0 - 20)) |
result = ((long long int) ((i0 & 0x000fffff) | 0x00100000) << (j0 - 20)) |
/* 64bit return: right shift amt in [0,10] */
(i1 << (j0 - 52));
((long long int) i1 << (j0 - 52));
else
{
/* 64bit return: j0 in [20,51] */
Expand Down
4 changes: 2 additions & 2 deletions newlib/libm/common/s_lrint.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ TWO52[2]={
if (j0 >= 52)
/* 64bit return: j0 in [52,62] */
/* 64bit return: left shift amt in [32,42] */
result = ((long int) ((i0 & 0x000fffff) | 0x0010000) << (j0 - 20)) |
result = ((long int) ((i0 & 0x000fffff) | 0x00100000) << (j0 - 20)) |
/* 64bit return: right shift amt in [0,10] */
(i1 << (j0 - 52));
((long int) i1 << (j0 - 52));
else
{
/* 32bit return: j0 in [20,30] */
Expand Down

0 comments on commit c0372b6

Please sign in to comment.