Modifying the value of a float-like object

Eric.Le.Bigot at spectro.jussieu.fr Eric.Le.Bigot at spectro.jussieu.fr
Wed Apr 15 15:01:11 CEST 2009


Arnaud, your code is very interesting!

On Apr 15, 1:00 pm, Arnaud Delobelle <arno... at googlemail.com> wrote:
> I still don't understand why you need mutable floats.

Here is why: the code that your proposed (or any code that does
straightforward error propagation, for that matter) does not generally
calculate uncertainties correctly:

>>> a=Value(1, 0.1)
>>> a-a
0.0 +- 0.14142135623823598

The correct result is obviously 0.0 +- 0.0.  This is the effect of
what I referred to in previous posts as "correlated errors".

Anyway, I learned some interesting stuff about what you can do in
Python, thanks to your code! :)



More information about the Python-list mailing list