[Numpy-discussion] Numpy complex types, packing and C99
Thu Jul 2 06:56:11 CDT 2009
On Thu, Jul 2, 2009 at 9:02 AM, David Cournapeau<firstname.lastname@example.org> wrote:
> True, but we can deal with this once we have tests: we can force to
> use our own, fixed implementations on broken platforms. The glibc
> complex functions are indeed not great, I have noticed quite a few
> problems for special value handling (e.g. cabs(inf + I * NAN) is nan,
> but should be inf, etc....).
Ok, here we are. There are two branches.
- the first one, complex_umath_tests, is a branch with thorough
covering of special values. I use the C99 standard for reference:
The main file is
Around 10 tests fail on Linux ATM.
- the second branch is the interesting one:
It implements clog, cexp, creal, cimag, carg, cabs, ccos, csin and
csqrt. The list is dictated by my needs for windows 64, but the list
can grow arbitrarily, of course. Most the implementations are taken
from msun (the math library of FreeBSD). Unfortunately, they don't
implement that many functions compared to the glibc.
If I merge the two branches and use the npymath complex functions in
umath, there is no unit test failures anymore :)
I think I will merge the complex_umath_tests branch soon
(platform-specific failures on build bot will be interesting), unless
someone sees a problem with it.
More information about the Numpy-discussion