Tim Roberts <[EMAIL PROTECTED]> writes:
> "Math" <[EMAIL PROTECTED]> wrote:
>>And yes, I really need this accuracy..
>
> Then you need to understand that you don't really HAVE this accuracy.
With the Decimal type, you do.
>>> import decimal
>>> decimal.getcontext().prec = 5
>>> deci
"Math" <[EMAIL PROTECTED]> wrote:
>
>Thanks this does the job
>And yes, I really need this accuracy..
Then you need to understand that you don't really HAVE this accuracy. You
are fooling yourself. 1090.516455488 cannot be represented exactly in
binary, just like 1/3 cannot be represented exac
Thanks this does the job
And yes, I really need this accuracy..
Many Thanks
- Original Message -
From: "Felipe Almeida Lessa" <[EMAIL PROTECTED]>
To: "Fredrik Lundh" <[EMAIL PROTECTED]>
Cc:
Sent: Tuesday, March 28, 2006 6:00 PM
Subject: Re: 1.0905164
On Tue, 2006-03-28 at 16:29 +0200, Math wrote:
> Hello,
>
> I got a simple and probably stupid newby question..
> When I compute:
> 1.090516455488E9 / 100
> the result is 1090516455.49
> Should be 1090516455.488
>>> repr( 1.090516455488E9/100 )
'1090.516455488'
>>>
Works for me. Code s
Em Ter, 2006-03-28 às 16:59 +0200, Fredrik Lundh escreveu:
> and consider using
>
> http://www.python.org/doc/lib/module-decimal.html
>
> instead.
$ python2.4
Python 2.4.2 (#2, Nov 20 2005, 17:04:48)
[GCC 4.0.3 2005 (prerelease) (Debian 4.0.2-4)] on linux2
Type "help", "copyright", "cred
Math <[EMAIL PROTECTED]> wrote:
> I got a simple and probably stupid newby question..
> When I compute:
> 1.090516455488E9 / 100
> 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-po
"Math" wrote:
> I got a simple and probably stupid newby question..
> When I compute:
> 1.090516455488E9 / 100
> the result is 1090516455.49
> Should be 1090516455.488
assuming you meant ~1090, it is:
>>> 1.090516455488E9 / 100
1090.516455488
unless you round it off to 12 significant di
Math wrote:
> Hello,
>
> I got a simple and probably stupid newby question..
> When I compute:
> 1.090516455488E9 / 100
> the result is 1090516455.49
> Should be 1090516455.488
>
> I know something with float and //...
>
> Anybody?
> How do I get correct number?
Python 2.4.2 (#1, Mar 12 20
>>> 1.090516455488E9 / 100
1090.516455488
--
http://mail.python.org/mailman/listinfo/python-list
Should be 1.090516455488E15
- Original Message -
From: "Math" <[EMAIL PROTECTED]>
To:
Sent: Tuesday, March 28, 2006 4:29 PM
Subject: 1.090516455488E9 / 100.000 ???
> Hello,
>
> I got a simple and probably stupid newby question..
> When I compute:
Hello,
I got a simple and probably stupid newby question..
When I compute:
1.090516455488E9 / 100
the result is 1090516455.49
Should be 1090516455.488
I know something with float and //...
Anybody?
How do I get correct number?
--
http://mail.python.org/mailman/listinfo/python-list
11 matches
Mail list logo