This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCHv2 4/5] ldbl-128: Use L(x) macro for long double constants


On Thu, 18 Aug 2016, Paul E. Murphy wrote:

> 	diff --git a/sysdeps/ieee754/ldbl-128/s_llrintl.c b/sysdeps/ieee754/ldbl-128/s_llrintl.c
> 	index d103575..8e91378 100644
> 	--- a/sysdeps/ieee754/ldbl-128/s_llrintl.c
> 	+++ b/sysdeps/ieee754/ldbl-128/s_llrintl.c
> 	@@ -84,7 +84,7 @@ __llrintl (_Float128 x)
> 		 unspecified.  */
> 	 #if defined FE_INVALID || defined FE_INEXACT
> 	       if (x < (_Float128) LLONG_MIN
> 	-	  && x > (_Float128) LLONG_MIN - 1)
> 	+	  && x > (_Float128) LLONG_MIN - L(1.0))
> 		{
> 		  /* If truncation produces LLONG_MIN, the cast will not raise
> 		     the exception, but may raise "inexact".  */
> 	diff --git a/sysdeps/ieee754/ldbl-128/s_lrintl.c b/sysdeps/ieee754/ldbl-128/s_lrintl.c
> 	index 6f36b80..a822702 100644
> 	--- a/sysdeps/ieee754/ldbl-128/s_lrintl.c
> 	+++ b/sysdeps/ieee754/ldbl-128/s_lrintl.c
> 	@@ -113,7 +113,7 @@ __lrintl (_Float128 x)
> 		 unspecified.  */
> 	 #if defined FE_INVALID || defined FE_INEXACT
> 	       if (x < (_Float128) LONG_MIN
> 	-	  && x > (_Float128) LONG_MIN - 1)
> 	+	  && x > (_Float128) LONG_MIN - L(1.0))

These should not be part of the minimal necessary set of fixes.  
Subtracting integer 1 from a floating-point value is fine (casts have 
higher precedence than binary operators).

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]