In numerical analysis there is this concept of machine zero, which is computed like this:
e=1.0 while 1.0+e > 1.0: e=e/2.0 print e The number e will give you the precision of floating point numbers. Lalitha Prasad On Sun, Jun 26, 2011 at 9:05 PM, Harold <dadap...@googlemail.com> wrote: > > >I'm curious. Is there a way to get the number of significant digits > > >for a particular Decimal instance? > > > > Yes: > > > > def sigdig(x): > > "return the number of significant digits in x" > > return len(x.as_tuple()[1]) > > Great! that's exactly what I needed. > thanks Chris! > -- > http://mail.python.org/mailman/listinfo/python-list >
-- http://mail.python.org/mailman/listinfo/python-list