use python as a calculator
Peter Otten
__peter__ at web.de
Thu Jun 24 13:03:06 EDT 2010
More information about the Python-list mailing list
Thu Jun 24 13:03:06 EDT 2010
- Previous message (by thread): use python as a calculator
- Next message (by thread): deprecated string module issue
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
ilovesss2004 wrote: > If I run > 1.0/10**10 > python will return 0 > > How can I make python return 1e-10? If you meant 1/10**10, by default this returns an integer in Python 2.x. With "from __future__ import division" you can opt for the division of integers to return a float: >>> 1/10**10 0 >>> from __future__ import division >>> 1/10**10 1e-10 Python 3.x will return a float by default. Peter
- Previous message (by thread): use python as a calculator
- Next message (by thread): deprecated string module issue
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list