This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
cpow(0, 0) vs pow(0, 0)
- From: Paolo Carlini <pcarlini at suse dot de>
- To: libc-alpha at sources dot redhat dot com
- Date: Tue, 08 Mar 2005 01:01:27 +0100
- Subject: cpow(0, 0) vs pow(0, 0)
Hi,
sorry about the down to earth question: which is the rationale behind
cpow(0, 0) returning (nan, nan)?!?
Wouldn't be (1, 0) more consistent with the behavior of pow(0, 0), as
per F.9.4.4?!? Also, FWIW, this seems more consistent with the value
returned by mathematical packages like "Maple", and, of course, in my
reading, doesn't run against the letter of the C99 standard, which is
rather vague in this area.
As you may imagine, this is not just an academical question: when
implementing complex::pow in the C++ runtime library (which uses
internally both cpow and pow) inconsistencies may arise quickly in
special cases.
Thanks in advance for any feedback,
Paolo.