Mel wrote:
Erik Max Francis wrote:
Mel wrote:
By convention, nobody ever talks about 1 x 9.97^6 .
Not sure what the relevance is, since nobody had mentioned any such thing.
If it was intended as a gag, I don't catch the reference.
I get giddy once in a while.. push things to limits. It doe
Erik Max Francis wrote:
> Mel wrote:
>> Erik Max Francis wrote:
>>
>>> Chris Angelico wrote:
On Tue, Jun 28, 2011 at 12:56 PM, Steven D'Aprano
wrote:
> Zero sig figure: 0
>>> That's not really zero significant figures; without further
>>> qualification, it's one.
>>>
Is 0.0 on
Steven D'Aprano wrote:
On Tue, 28 Jun 2011 01:16 pm Chris Angelico wrote:
On Tue, Jun 28, 2011 at 12:56 PM, Steven D'Aprano
wrote:
Zero sig figure: 0
Is 0.0 one sig fig or two? (Just vaguely curious. Also curious as to
whether a zero sig figures value is ever useful.)
Two. I was actually
Mel wrote:
Erik Max Francis wrote:
Chris Angelico wrote:
On Tue, Jun 28, 2011 at 12:56 PM, Steven D'Aprano
wrote:
Zero sig figure: 0
That's not really zero significant figures; without further
qualification, it's one.
Is 0.0 one sig fig or two?
Two.
(Just vaguely curious. Also curious
On Tue, Jun 28, 2011 at 9:47 PM, Mel wrote:
>
> By convention, nobody ever talks about 1 x 9.97^6 .
Unless you're a British politician of indeterminate party
allegiance famous line, quoted as #6 in here:
http://www.telegraph.co.uk/culture/tvandradio/7309332/The-ten-funniest-ever-Yes-Minister-
Erik Max Francis wrote:
> Chris Angelico wrote:
>> On Tue, Jun 28, 2011 at 12:56 PM, Steven D'Aprano
>> wrote:
>>> Zero sig figure: 0
>
> That's not really zero significant figures; without further
> qualification, it's one.
>
>> Is 0.0 one sig fig or two?
>
> Two.
>
>> (Just vaguely curious.
On Tue, 28 Jun 2011 01:16 pm Chris Angelico wrote:
> On Tue, Jun 28, 2011 at 12:56 PM, Steven D'Aprano
> wrote:
>> Zero sig figure: 0
>>
>
> Is 0.0 one sig fig or two? (Just vaguely curious. Also curious as to
> whether a zero sig figures value is ever useful.)
Two. I was actually being slightl
Steven D'Aprano wrote:
On Tue, 28 Jun 2011 06:53 am Ethan Furman wrote:
Harold wrote:
[...]
Empirical('1200.').significance
2
Well, that's completely wrong. It should be 4.
Empirical('1200.0').significance
5
What about when 1200 is actually 4 significant digits? Or 3?
Then you should
Chris Angelico wrote:
On Tue, Jun 28, 2011 at 12:56 PM, Steven D'Aprano
wrote:
Zero sig figure: 0
That's not really zero significant figures; without further
qualification, it's one.
Is 0.0 one sig fig or two?
Two.
(Just vaguely curious. Also curious as to
whether a zero sig figures v
On Tue, Jun 28, 2011 at 12:56 PM, Steven D'Aprano
wrote:
> Zero sig figure: 0
>
Is 0.0 one sig fig or two? (Just vaguely curious. Also curious as to
whether a zero sig figures value is ever useful.)
ChrisA
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 28 Jun 2011 06:53 am Ethan Furman wrote:
> Harold wrote:
[...]
> Empirical('1200.').significance
>> 2
Well, that's completely wrong. It should be 4.
> Empirical('1200.0').significance
>> 5
>
> What about when 1200 is actually 4 significant digits? Or 3?
Then you shouldn't write
Harold Fellermann wrote:
Hi Ethan,
Empirical('1200.').significance
2
Empirical('1200.0').significance
5
What about when 1200 is actually 4 significant digits? Or 3?
Then you'd simply write 1.200e3 and 1.20e3, respectively.
That's just how the rules are defined.
But your code is not foll
Harold wrote:
On Jun 25, 9:04 pm, Chris Torek wrote:
I'm curious. Is there a way to get the number of significant digits
for a particular Decimal instance?
Yes:
def sigdig(x):
"return the number of significant digits in x"
return len(x.as_tuple()[1])
Great, Chris, this is (almost)
On Jun 25, 9:04 pm, Chris Torek wrote:
> >I'm curious. Is there a way to get the number of significant digits
> >for a particular Decimal instance?
>
> Yes:
>
> def sigdig(x):
> "return the number of significant digits in x"
> return len(x.as_tuple()[1])
Great, Chris, this is (almost) ex
(You top-posted your reply, instead of writing your response following
the part you were quoting)
On 01/-10/-28163 02:59 PM, Lalitha Prasad K wrote:
In numerical analysis there is this concept of machine zero, which is
computed like this:
e=1.0
while 1.0+e> 1.0:
e=e/2.0
print e
The numb
In numerical analysis there is this concept of machine zero, which is
computed like this:
e=1.0
while 1.0+e > 1.0:
e=e/2.0
print e
The number e will give you the precision of floating point numbers.
Lalitha Prasad
On Sun, Jun 26, 2011 at 9:05 PM, Harold wrote:
> > >I'm curious. Is there
> >I'm curious. Is there a way to get the number of significant digits
> >for a particular Decimal instance?
>
> Yes:
>
> def sigdig(x):
> "return the number of significant digits in x"
> return len(x.as_tuple()[1])
Great! that's exactly what I needed.
thanks Chris!
--
http://mail.python
In article
Jerry Hill wrote:
>I'm curious. Is there a way to get the number of significant digits
>for a particular Decimal instance?
Yes:
def sigdig(x):
"return the number of significant digits in x"
return len(x.as_tuple()[1])
import decimal
D = decimal.Decimal
for x in (
'1',
> > I tried to modify the DecimalContext (e.g. getcontext().prec = 2) but
> > that did not lead to the correct behavior.
>
> Really? It works for me.
You are right, I did something wrong when attempting to set the
precision.
And the trick with rounding the decimal with the unary + is neat.
It's th
Jerry Hill wrote:
> I'm curious. Is there a way to get the number of significant digits
> for a particular Decimal instance? I spent a few minutes browsing
> through the docs, and didn't see anything obvious. I was thinking
> about setting the precision dynamically within a function, based on
>
On Fri, Jun 24, 2011 at 4:46 PM, Steven D'Aprano
wrote:
> Really? It works for me.
>
import decimal
D = decimal.Decimal
decimal.getcontext().prec = 2
D('32.01') + D('5.325') + D('12')
> Decimal('49')
I'm curious. Is there a way to get the number of significant digits
for
On Fri, 24 Jun 2011 13:05:41 -0700, Harold wrote:
> Hi,
>
> I am looking for an easy way to do significant figure calculations in
> python (which I want to use with a class that does unit calculations).
> Significant figure calculations should have the semantics explained,
> e.g., here:
> http://
Hi,
I am looking for an easy way to do significant figure calculations in
python (which I want to use with a class that does unit calculations).
Significant figure calculations should have the semantics explained,
e.g., here:
http://chemistry.about.com/od/mathsciencefundamentals/a/sigfigures.htm
23 matches
Mail list logo