This is the mail archive of the gcc@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: __builtin_cpow((0,0),(0,0))


Maybe i should make it more clearer, why 0^x is not defined for real exponents x, and not continual in any way.

Be G a set ("Menge" in german) and op : G x G -> G, (a,b) -> a op b.
If op is associative than (G,op) is called a half-group.
Therefore then exponentiation is defined as:
a from G, n from |N>0:
a^1 = a; a^n = a op a^(n-1)
If a neutral element is in G (mostly called the "1") than a^0 is defined as 1.


Example (Z,+) is a half-group (it's even a group). Therefor a^n = a + a + a + ... + a (n times).

For real exponents this is not defined in the above case, therefore
(Example: what would be 2^pi?) a definition which is in accordance to the previous one was defined:
For A,X from |R, A>0:
A^X = exp(X*ln(A))


with exp(N*X) = exp(X)^N (which can be proofed by induction) it can
be seen that it is in accordance to the previous definition (if X is from |N).


The rule a^(1/n) = n-th root of a comes from the proof:
Be a from |R, a>0 and p from Z, q from |N>1, then:

a^p = exp(p * ln(a)) = exp(q * (p/q) * ln(a)) = exp(p/q * ln(a))^q = (a^(p/q))^q => a^(p/q) = q-th root of a^p (remind that this is only true for a>0).

For 0^x there is no such definition except of x is from |N. Therefore 0^0 is defined as according to the first rule as 1 (because we look at
the group (|R,*) with a^n= a*a*a* ... *a (n times) and the neutral element 1, therefore a^0 = 1 for every element in |R).


I hope that this make things clearer for some who don't believe 0^0 = 1 in the real case.

cu, Ronny

Robert Dewar wrote:
Ronny Peine wrote:

Well this article was referenced by http://grouper.ieee.org/groups/754/, so i don't think it's an unreliable source.


Since Kahan is one of the primary movers behind 754 that's not so surprising.
For me, 754 is authoritative significantly because of this connection.
If there were a case where Kahan disagreed with 754, I would suspect
that the standard had made a mistake :-)





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