H
Harold
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
My hope was that the decimal module would provide this functionality,
but:
False # actually not sure how the semantics should be
I tried to modify the DecimalContext (e.g. getcontext().prec = 2) but
that did not lead to the correct behavior. Google and this list didn't
yield a good answer yet... so I'd be happy to get a good
recommendations or pointers.
P.S. I am aware that significant figure calculation is controversial
and makes implicit assumptions on the probability distributions of the
variables. I am simply looking for an implementation of the (well
defined) arithmetics as defined on the cited website.
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
My hope was that the decimal module would provide this functionality,
but:
False # actually not sure how the semantics should be
I tried to modify the DecimalContext (e.g. getcontext().prec = 2) but
that did not lead to the correct behavior. Google and this list didn't
yield a good answer yet... so I'd be happy to get a good
recommendations or pointers.
P.S. I am aware that significant figure calculation is controversial
and makes implicit assumptions on the probability distributions of the
variables. I am simply looking for an implementation of the (well
defined) arithmetics as defined on the cited website.