This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc 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]

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.


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