Skip to content
Commit 0e069029 authored by Joseph Myers's avatar Joseph Myers
Browse files

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.
parent d0d286d3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment