[Numpy-discussion] C99 on windows

Christian Heimes lists at cheimes.de
Fri Aug 15 22:09:33 EDT 2008


Charles R Harris wrote:
> I believe C99 was used as a guide to how complex corner cases involving
> +/-0, +/-inf, etc. should behave. However, it doesn't look possible to make
> that behaviour portable without a lot of work and it probably isn't worth
> the trouble. At the moment the failing tests have been removed.

We used the C99 specs as guideline, too. If I recall correctly mostly 
Annex F and G. We got it all sorted out but it took us a tremendous 
amount of time and work. We had to reimplement a bunch of math functions 
like log1p and the reversed hyperbolic functions. Mark introduced a 
system of lookup tables for complex corner cases. You can find them at 
the end of the cmath module:

http://svn.python.org/projects/python/trunk/Modules/cmathmodule.c

The new pymath files contain a series of macros and re-implemenation of 
C99 features and cross platform workarounds:

http://svn.python.org/projects/python/trunk/Include/pymath.h
http://svn.python.org/projects/python/trunk/Python/pymath.c

HTH
Christian




More information about the NumPy-Discussion mailing list