N
Neal D. Becker
Is there a way in python to access properties of floats? I need something
equiv to C DBL_EPSILON defined in <float.h>.
equiv to C DBL_EPSILON defined in <float.h>.
you could try the traditional algorithmNeal said:Is there a way in python to access properties of floats? I need something
equiv to C DBL_EPSILON defined in <float.h>.
Robin said:you could try the traditional algorithm
... n = 0
... while 1:
... e = 1.0/2**n
... if (1.0+e==1.0): break
... n += 1
... pe = e
... return pe
...
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.