"Thomas Bartkus" <[EMAIL PROTECTED]> wrote:
> "Grant Edwards" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> On 2006-05-08, Thomas Bartkus <[EMAIL PROTECTED]> wrote:
>>
>> >> does python support true rations, which means that 1/3 is a
>> >> true one-third and not 0.3 roun
"chun ping wang" <[EMAIL PROTECTED]> wrote:
>
>Hey i have a stupid question.
>
>How do i get python to print the result in only three decimal place...
>
>Example>>> round (2.9954254, 3)
>2.9951
>
>but i want to get rid of all trailing 0's..how would i do that?
Your "problem" is
Grant Edwards wrote:
> On 2006-05-09, Dan Bishop <[EMAIL PROTECTED]> wrote:
> > Grant Edwards wrote:
> > ...
> >> Did they actually have 60 unique number symbols and use
> >> place-weighting in a manner similar to the arabic/indian system
> >> we use?
> >
> > The Bablyonians did use a place-value s
On 2006-05-09, Dan Bishop <[EMAIL PROTECTED]> wrote:
> Grant Edwards wrote:
> ...
>> Did they actually have 60 unique number symbols and use
>> place-weighting in a manner similar to the arabic/indian system
>> we use?
>
> The Bablyonians did use a place-value system, but they only had two
> basic
Grant Edwards wrote:
...
> Did they actually have 60 unique number symbols and use
> place-weighting in a manner similar to the arabic/indian system
> we use?
The Bablyonians did use a place-value system, but they only had two
basic numerals: a Y-like symbol for 1 and a <-like symbol for ten.
Thes
On 2006-05-09, Thomas Bartkus <[EMAIL PROTECTED]> wrote:
>>> Even base 60 makes more sense if you like it when a lot of
>>> divisions come out nice and even.
>>
>> Did they actually have 60 unique number symbols and use
>> place-weighting in a manner similar to the arabic/indian
>> system we use?
"Grant Edwards" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 2006-05-08, Thomas Bartkus <[EMAIL PROTECTED]> wrote:
>
> >> Or you can write 0.1
> >> 3
> >>
> >> :)
> >
> > Ahhh!
> >
> > But if I need to store the value 1/10 (decimal!), what kind of
> > a pre
On 2006-05-08, Thomas Bartkus <[EMAIL PROTECTED]> wrote:
>> Or you can write 0.1
>> 3
>>
>> :)
>
> Ahhh!
>
> But if I need to store the value 1/10 (decimal!), what kind of
> a precision pickle will I then find myself while working in
> base 3?
Then we're right back where we
"Grant Edwards" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 2006-05-08, Thomas Bartkus <[EMAIL PROTECTED]> wrote:
>
> >> does python support true rations, which means that 1/3 is a
> >> true one-third and not 0.3 rounded off at some
> >> arbitrary precision?
> >
> > At
On 2006-05-08, Thomas Bartkus <[EMAIL PROTECTED]> wrote:
>> does python support true rations, which means that 1/3 is a
>> true one-third and not 0.3 rounded off at some
>> arbitrary precision?
>
> At risk of being boring ;-)
>
> - Python supports both rational and irrational numbers as
>
"Gary Wessle" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Erik Max Francis <[EMAIL PROTECTED]> writes:
>
> > chun ping wang wrote:
> >
> > > Hey i have a stupid question.
> > > How do i get python to print the result in only three decimal
> > > place...
> > > Example>>> round (2.9
Gary Wessle wrote:
> Erik Max Francis <[EMAIL PROTECTED]> writes:
>
>
>>chun ping wang wrote:
>>
>>
>>>Hey i have a stupid question.
>>>How do i get python to print the result in only three decimal
>>>place...
>>>Example>>> round (2.9954254, 3)
>>>2.9951
>>>but i want to get r
Erik Max Francis <[EMAIL PROTECTED]> writes:
> chun ping wang wrote:
>
> > Hey i have a stupid question.
> > How do i get python to print the result in only three decimal
> > place...
> > Example>>> round (2.9954254, 3)
> > 2.9951
> > but i want to get rid of all trailing 0's.
Erik Max Francis wrote:
> chun ping wang wrote:
>
> > Hey i have a stupid question.
> >
> > How do i get python to print the result in only three decimal place...
> >
> > Example>>> round (2.9954254, 3)
> > 2.9951
> >
> > but i want to get rid of all trailing 0's..how would i d
chun ping wang wrote:
> Hey i have a stupid question.
>
> How do i get python to print the result in only three decimal place...
>
> Example>>> round (2.9954254, 3)
> 2.9951
>
> but i want to get rid of all trailing 0's..how would i do that?
Floating point arithmetic is inh
Hey i have a stupid question.
How do i get python to print the result in only three decimal place...
Example>>> round (2.9954254, 3)
2.9951
but i want to get rid of all trailing 0's..how would i do that?
_
Expre
Dan Bishop wrote:
Your statement is misleading, because it suggests that your processor
stores digits. It doesn't; it stores *bits*.
And where does the word 'bit' come from, hmm? It couldn't possibly be an
abbreviation of Binary digIT, could it?
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECT
"Dan Bishop" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> tom wrote:
> > That last digit will *always* contain some arithmetic slop.
>
> Your statement is misleading, because it suggests that your processor
> stores digits. It doesn't; it stores *bits*.
Your explanation is much
tom wrote:
> On Wed, 23 Feb 2005 19:04:47 -0600, Andy Leszczynski wrote:
>
> > It is on Windows, Linux, Python 2.3:
> >
> > [GCC 3.3.2 (Mandrake Linux 10.0 3.3.2-6mdk)] on linux2 Type "help",
> > "copyright", "credits" or "license" for more information.
> > >>> a=1.1
> > >>> a
> > 1.1
On Wed, 23 Feb 2005 19:04:47 -0600, Andy Leszczynski wrote:
> It is on Windows, Linux, Python 2.3:
>
> [GCC 3.3.2 (Mandrake Linux 10.0 3.3.2-6mdk)] on linux2 Type "help",
> "copyright", "credits" or "license" for more information.
> >>> a=1.1
> >>> a
> 1.1001
> >>>
> >>>
> >>>
>
> Is it normal?
Yes. The interpreter prints back the repr of a, which reflects the
imprecision inherent in floats. If you want '1.1', use the string
returned by the str function.
>>> a = 1.1
>>> a
1.1001
>>> repr(a)
'1.1001'
>>> str(a)
'1.1'
Michael
--
Michael D. Hartl
In article <[EMAIL PROTECTED]>, Andy Leszczynski wrote:
> >>> a=1.1
> >>> a
> 1.1001
> >>>
>
>
> Is it normal?
Yes, for floating-point numbers. This is due to inherent imprecision
in how floats are represented in hardware. If you can live with being
a touch off that many decimal plac
In article <[EMAIL PROTECTED]>,
Andy Leszczynski <[EMAIL PROTECTED]> wrote:
>It is on Windows, Linux, Python 2.3:
>
>[GCC 3.3.2 (Mandrake Linux 10.0 3.3.2-6mdk)] on linux2
>Type "help", "copyright", "credits" or "license" for more information.
> >>> a=1.1
> >>> a
>1.1001
> >>>
>
>
>Is
It is on Windows, Linux, Python 2.3:
[GCC 3.3.2 (Mandrake Linux 10.0 3.3.2-6mdk)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> a=1.1
>>> a
1.1001
>>>
Is it normal?
Andy
--
http://mail.python.org/mailman/listinfo/python-list
24 matches
Mail list logo