3

I understand in cython some precision is lost, because a cython float is not the same as a python float. Consequently I redifined a variable as follows:

cdef long double variable=1*10**-10
print variable
0.0

This failed however:

cdef long double variable=0.0000000001
print variable
1e-10

was successful. I need to perform relatively precise calculations so I am keen to understand this behavior.

1 Answers1

2

See here, it seems this bug is fixed in Cython 3.0

https://github.com/cython/cython/issues/2133

roughman
  • 21
  • 2