cpow(0, 0) vs pow(0, 0)

Paolo Carlini pcarlini@suse.de
Mon Mar 7 23:58:00 GMT 2005


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.



More information about the Libc-alpha mailing list