From: ilovesss2004 on
If I run
1.0/10**10
python will return 0

How can I make python return 1e-10?
From: Tim Harig on
On 2010-06-24, ilovesss2004 <yyiilluuoo(a)gmail.com> wrote:
> If I run
> 1.0/10**10
> python will return 0

Python 2.6.4 (r264:75706, Dec 11 2009, 23:02:59)
[GCC 3.4.6] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 1.0/10**10
1e-10
>>>

What version are you using?

> How can I make python return 1e-10?

If necessary, cast everything to a float:

>>> 1.0/float(10**10)
1e-10
>>>
From: Thomas Jollans on
On 06/24/2010 05:42 PM, ilovesss2004 wrote:
> If I run
> 1.0/10**10
> python will return 0
>
> How can I make python return 1e-10?

It returns 1e-10.
From: D'Arcy J.M. Cain on
On Thu, 24 Jun 2010 08:42:32 -0700 (PDT)
ilovesss2004 <yyiilluuoo(a)gmail.com> wrote:
> If I run
> 1.0/10**10
> python will return 0
>
> How can I make python return 1e-10?

What version of Python are you using?

Python 2.6.4 (r264:75706, Jan 28 2010, 11:26:00)
[GCC 4.2.1 20070719 [FreeBSD]] on freebsd7
Type "help", "copyright", "credits" or "license" for more information.
>>> 1.0/10**10
1e-10

--
D'Arcy J.M. Cain <darcy(a)druid.net> | Democracy is three wolves
http://www.druid.net/darcy/ | and a sheep voting on
+1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.
From: ilovesss2004 on
On Jun 24, 5:50 pm, Tim Harig <user...(a)ilthio.net> wrote:
> On 2010-06-24, ilovesss2004 <yyiillu...(a)gmail.com> wrote:
>
> > If I run
> > 1.0/10**10
> > python will return 0
>
> Python 2.6.4 (r264:75706, Dec 11 2009, 23:02:59)
> [GCC 3.4.6] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>
> >>> 1.0/10**10
> 1e-10
>
> What version are you using?
>
> > How can I make python return 1e-10?
>
> If necessary, cast everything to a float:
>
>
>
>
>
> >>> 1.0/float(10**10)
> 1e-10

I use python 2.5
Must change version? Is there any other solution?