Math <[EMAIL PROTECTED]> wrote: > I got a simple and probably stupid newby question.. > When I compute: > 1.090516455488E9 / 1000000 > the result is 1090516455.49 > Should be 1090516455.488 > > I know something with float and //...
http://www.python.org/doc/faq/general/#why-are-floating-point-calculations-so-inaccurate Eg >>> a=1.090516455488E9 / 1000000 >>> print a 1090.51645549 >>> print repr(a) 1090.516455488 >>> If you want a given number of decimal places you can use a formatter, eg >>> print "%.20f" % a 1090.51645548800001961354 -- Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list