This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug math/19095] dbl-64 lrint incorrect for 64-bit long
- From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Fri, 09 Oct 2015 00:33:10 +0000
- Subject: [Bug math/19095] dbl-64 lrint incorrect for 64-bit long
- Auto-submitted: auto-generated
- References: <bug-19095-131 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=19095
--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via 0e069029a8bb132876d315242054a312ae106852 (commit)
from d0d286d32dda654f8983e8fe77bca0a2cda2051b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=0e069029a8bb132876d315242054a312ae106852
commit 0e069029a8bb132876d315242054a312ae106852
Author: Joseph Myers <joseph@codesourcery.com>
Date: Fri Oct 9 00:32:14 2015 +0000
Fix dbl-64 lrint for 64-bit long (bug 19095).
The dbl-64 implementation of lrint produces incorrect results for some
arguments with 64-bit long because a 32-bit (unsigned) low part of the
mantissa is shifted left, losing high bits in the process. This patch
fixes this by casting to long int before shifting, as in lround (as
this case only applies for 64-bit long, there are no issues with
sign-extension).
Tested for mips64 (n64).
[BZ #19095]
* sysdeps/ieee754/dbl-64/s_lrint.c (__lrint): Cast low part of
mantissa to long int before shifting left.
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 6 ++++++
NEWS | 2 +-
sysdeps/ieee754/dbl-64/s_lrint.c | 2 +-
3 files changed, 8 insertions(+), 2 deletions(-)
--
You are receiving this mail because:
You are on the CC list for the bug.