[Pyrex] [Fwd: [Bug 218377] [NEW] special floats generate incorrect C code when used as compile-time constants]

Greg Ewing greg.ewing at canterbury.ac.nz
Wed Apr 23 01:13:00 CEST 2008


Stefan Behnel wrote:
>   DEF INFINITY = float('inf')
>   print INFINITY
> 
> results in:
> 
>   foo.c: In function ‘init2foo’:
>   foo.c:158: error: ‘inf’ undeclared (first use in this function)

I'm not sure whether to do anything about this for Pyrex.
As I understand it, Python doesn't promise anything about
representation of inf and nan, so it's platform dependent.
I'm inclined to think that using an appropriate constant
from your platform's math.h is the right thing to do.

-- 
Greg





More information about the Pyrex mailing list