This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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] Optimize pow(x,0.0) = pow (1.0,y) = 1.0


On Fri, 21 Feb 2003, Paolo Bonzini wrote:
> ...which is completely braindead.  Your reference is correct, the problem
> is in the ISO C99 spec.  pow(0.0, 0.0) == 1.0 according to the standard
> but not according to the math.

It wouldn't be the first time that I disagree with the ISO C
committee.  Did I ever mention I had the world's fastest "qsort"
implementation, until somebody pointed out that it violated ISO's
"braindead" rules for pointer bounds when calling the comparison
function and so it was pulled from glibc.

http://sources.redhat.com/ml/libc-alpha/2002-01/msg00218.html

[It has the nice feature that its also "stable", preserving the order
of elements that compare equal, so unlike system qsort(3) produces the
same "portable" result across platforms].

Roger
--


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