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: [PATCH] Fix math functions triggering invalid exceptions


From: Aurelien Jarno <aurelien@aurel32.net>
Date: Wed, 15 Feb 2012 19:43:52 +0100

> Commits bcf01e6d and 0ac5ae23 optimized math functions by, among other
> things, removing the special cases for NaN, and letting them propagate
> through the whole code. The idea seems good, given that NaN should be
> considered as the exception rather than the rule, but the floating point
> comparison operators in C are signaling operations. Thus on 
> architectures using the changed code, an invalid exception is triggered
> when a mathematical function is passed a NaN. This violates the C
> specification.
> 
> As a consequence, test-float, test-ifloat, test-double and test-idouble
> are failing on at least arm, mips, ia64 and sparc. Architectures like
> x86, x86-64 or s390 are not affected given they have their own
> implementation of most floating point functions.
> 
> The patch below addresses the issue by using non-signaling
> floating-point comparisons, that is functions like isgreater, isless or
> isgreaterequal.

Thanks for fixing this.


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