On 2022-12-19 16:14, MRAB wrote:
To be fair, I don't think I've never seen that notation either! I've
only ever seen the form 6.67430E-11 ± 0.00015E-11, which is much clearer.
We use it regularly in our experimental data: 6.3(4), 15.002(10). Things
would become complex using exponential forms
On 19/12/2022 09.14, MRAB wrote:
On 2022-12-19 14:10, Peter J. Holzer wrote:
On 2022-12-19 09:25:17 +1100, Chris Angelico wrote:
On Mon, 19 Dec 2022 at 07:57, Stefan Ram wrote:
> G = Decimal( 6.6743015E-11 )
> r = Decimal( 6.371E6 )
> M = Decimal( 5.9722E24 )
What's the point of using Decimal
On 17/12/2022 18:55, Stefan Ram wrote:
> Grant Edwards writes:
>> Yes, fixed point (or decimal) is a better fit for what he's doing. but
>> I suspect that floating point would be a better fit for the problem
>> he's trying to solve.
>
> I'd like to predict that within the next ten posts in this
On 19/12/22 9:24 am, Stefan Ram wrote:
So what's the time until a mass of one gram
arrives at the ground versus a mass of ten grams? I think
one needs "Decimal" to calculate this!
Or you can be smarter about how you calculate it.
Differentiating t with respect to m gives
dt/dm = -0.5 * sqr
On 2022-12-19 15:14:14 +, MRAB wrote:
> On 2022-12-19 14:10, Peter J. Holzer wrote:
> > He also interpreted the notation "6.67430(15)E-11" wrong. The
> > digits in parentheses represent the uncertainty in the same number of
> > last digits. So "6.67430(15)E-11" means "something between 6.67430E
On 2022-12-19 14:10, Peter J. Holzer wrote:
On 2022-12-19 09:25:17 +1100, Chris Angelico wrote:
On Mon, 19 Dec 2022 at 07:57, Stefan Ram wrote:
> G = Decimal( 6.6743015E-11 )
> r = Decimal( 6.371E6 )
> M = Decimal( 5.9722E24 )
What's the point of using Decimal if you start with nothing more th
On 12/19/2022 9:10 AM, Peter J. Holzer wrote:
On 2022-12-19 09:25:17 +1100, Chris Angelico wrote:
On Mon, 19 Dec 2022 at 07:57, Stefan Ram wrote:
G = Decimal( 6.6743015E-11 )
r = Decimal( 6.371E6 )
M = Decimal( 5.9722E24 )
What's the point of using Decimal if you start with nothing more than
On 2022-12-19 09:25:17 +1100, Chris Angelico wrote:
> On Mon, 19 Dec 2022 at 07:57, Stefan Ram wrote:
> > G = Decimal( 6.6743015E-11 )
> > r = Decimal( 6.371E6 )
> > M = Decimal( 5.9722E24 )
>
> What's the point of using Decimal if you start with nothing more than
> float accuracy?
Right. He als
On 19Dec2022 08:53, Cameron Simpson wrote:
I'm no expert on floating point coding for precision, but I believe
that trying to work with values "close together" in magnitude is
important because values of different scales inherently convert one of
them to the other scale (i.e. similar sized exp
On 19/12/22 6:35 am, Paul St George wrote:
So I am working on a physics paper with a colleague. We have a theory about
Newtons Cradle.
We want to illustrate the paper with animations.
Because there is a problem, I am investigating in all areas. ... I would like
to be in control of or fully aw
On Mon, 19 Dec 2022 at 07:57, Stefan Ram wrote:
> G = Decimal( 6.6743015E-11 )
> r = Decimal( 6.371E6 )
> M = Decimal( 5.9722E24 )
What's the point of using Decimal if you start with nothing more than
float accuracy?
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
On 18Dec2022 18:35, Paul St George wrote:
So I am working on a physics paper with a colleague. We have a theory about
Newtons Cradle. We answer the question why when you lift and drop balls 1 and
2, balls 4 and 5 rise up. I could say more, but ... (if you are interested
please write to me).
On 18/12/2022 10.55, Stefan Ram wrote:
Grant Edwards writes:
Yes, fixed point (or decimal) is a better fit for what he's doing. but
I suspect that floating point would be a better fit for the problem
he's trying to solve.
I'd like to predict that within the next ten posts in this
thread
So I am working on a physics paper with a colleague. We have a theory about
Newtons Cradle. We answer the question why when you lift and drop balls 1 and
2, balls 4 and 5 rise up. I could say more, but ... (if you are interested
please write to me).
We want to illustrate the paper with animatio
On Sun, 18 Dec 2022 11:14:28 -0500, Dennis Lee Bieber wrote:
> .. And maybe lament the days when a 3-digit result was acceptable in
> math class -- being the typical capability in reading a standard (10"
> scale) slide rule.
Arguably more thought was given to what those three digits meant in the
Thanks for filling us in! I wouldn't think the animations themselves
would need such precision, though perhaps the calculations of the forces
and motions do. One way to check might be to perturb the initial
conditions a bit and see if the changes in the motions seem to be
correspondingly smal
So I am working on a physics paper with a colleague. We have a theory about
Newtons Cradle. We answer the question why when you lift and drop balls 1 and
2, balls 4 and 5 rise up. I could say more, but ... (if you are interested
please write to me).
We want to illustrate the paper with animatio
: python-list@python.org
Subject: Re: String to Float, without introducing errors
On 12/17/22 07:15, Thomas Passin wrote:
> You have strings, and you want to end up with numbers. The numbers
> are not integers. Other responders have gone directly to whether you
> should use float or decim
On Sun, 18 Dec 2022 at 09:46, Stefan Ram wrote:
>
> Grant Edwards writes:
> >Yes, fixed point (or decimal) is a better fit for what he's doing. but
> >I suspect that floating point would be a better fit for the problem
> >he's trying to solve.
>
> I'd like to predict that within the next ten po
On 18/12/2022 01.39, Peter J. Holzer wrote:
On 2022-12-17 12:51:17 +0100, Paul St George wrote:
I have a large/long array of numbers in an external file. The numbers
look like this:
-64550.727
-64511.489
-64393.637
[...]
When I bring the numbers into my code, they are Strings. To use the
num
On 12/17/2022 3:45 PM, Paul St George wrote:
Thanks to all!
It was the rounding rounding error that I needed to avoid (as Peter J. Holzer
suggested). The use of decimal solved it and just in time. I was about to
truncate the number, get each of the characters from the string mantissa, and
then
On 2022-12-17 21:45:06 +0100, Paul St George wrote:
> It was the rounding rounding error that I needed to avoid (as Peter J.
> Holzer suggested). The use of decimal solved it and just in time. I
> was about to truncate the number, get each of the characters from the
> string mantissa, and then do s
On Sun, 18 Dec 2022 at 08:22, Grant Edwards wrote:
>
> On 2022-12-17, Chris Angelico wrote:
>
> >> It was the rounding rounding error that I needed to avoid (as Peter
> >> J. Holzer suggested). The use of decimal solved it and just in
> >> time. I was about to truncate the number, get each of the
On 2022-12-17, Chris Angelico wrote:
>> It was the rounding rounding error that I needed to avoid (as Peter
>> J. Holzer suggested). The use of decimal solved it and just in
>> time. I was about to truncate the number, get each of the
>> characters from the string mantissa, and then do something
On Sun, 18 Dec 2022 at 07:46, Paul St George wrote:
>
> Thanks to all!
> It was the rounding rounding error that I needed to avoid (as Peter J. Holzer
> suggested). The use of decimal solved it and just in time. I was about to
> truncate the number, get each of the characters from the string man
Thanks to all!
It was the rounding rounding error that I needed to avoid (as Peter J. Holzer
suggested). The use of decimal solved it and just in time. I was about to
truncate the number, get each of the characters from the string mantissa, and
then do something like this:
64550.727
64550 + (7
On 12/17/2022 1:41 PM, Mats Wichmann wrote:
On 12/17/22 07:15, Thomas Passin wrote:
You have strings, and you want to end up with numbers. The numbers
are not integers. Other responders have gone directly to whether you
should use float or decimal as the conversion, but that is a secondary
m
On 12/17/22 07:15, Thomas Passin wrote:
You have strings, and you want to end up with numbers. The numbers are
not integers. Other responders have gone directly to whether you should
use float or decimal as the conversion, but that is a secondary matter.
If you have integers, convert with
i
You have strings, and you want to end up with numbers. The numbers are
not integers. Other responders have gone directly to whether you should
use float or decimal as the conversion, but that is a secondary matter.
If you have integers, convert with
integer = int(number_string)
If you don't
On 2022-12-17 12:51:17 +0100, Paul St George wrote:
> I have a large/long array of numbers in an external file. The numbers
> look like this:
>
> -64550.727
> -64511.489
> -64393.637
[...]
>
> When I bring the numbers into my code, they are Strings. To use the
> numbers in my code, I want to chan
On 17/12/2022 11:51, Paul St George wrote:
> I have a large/long array of numbers in an external file. The numbers look
> like this:
>
> -64550.727
> -64511.489
> -64393.637
> -64196.763
> -63920.2
> When I bring the numbers into my code, they are Strings. To use the
> numbers in my code, I wan
https://docs.python.org/3/library/decimal.html
Get Outlook for iOS<https://aka.ms/o0ukef>
From: Python-list on
behalf of Paul St George
Sent: Saturday, December 17, 2022 6:51:17 AM
To: python-list@python.org
Subject: String to Float, without introducing
I have a large/long array of numbers in an external file. The numbers look like
this:
-64550.727
-64511.489
-64393.637
-64196.763
-63920.2
-63563.037
-63124.156
-62602.254
-61995.895
-61303.548
-60523.651
-59654.66
...
When I bring the numbers into my code, they are Strings. To use the numbers i
33 matches
Mail list logo