special floats generate incorrect C code when used as compile-time constants
Bug #218377 reported by
Jacques Frechet
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cython |
Fix Committed
|
Medium
|
Unassigned |
Bug Description
For example:
DEF INFINITY = float('inf')
print INFINITY
results in:
foo.c: In function ‘init2foo’:
foo.c:158: error: ‘inf’ undeclared (first use in this function)
foo.c:158: error: (Each undeclared identifier is reported only once
foo.c:158: error: for each function it appears in.)
I get the same error message with -inf and a somewhat different error message with nan (since math.h defines a function by that name).
In the meantime, I'll do this instead:
cdef extern from "math.h":
double INFINITY, NAN
To post a comment you must log in.
Fixed in cython-devel. Thanks!