This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Optimize pow(x,0.0) = pow (1.0,y) = 1.0
- From: Roger Sayle <roger at www dot eyesopen dot com>
- To: bonzini at gnu dot org
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 21 Feb 2003 09:38:37 -0700 (MST)
- Subject: 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.
[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].