"Strong typing vs. strong testing"
Rui Maciel
rui.maciel at gmail.com
Fri Oct 1 09:38:35 EDT 2010
George Neuner wrote:
> That's true. But it is a situation where the conversion to SI units
> loses precision and therefore probably shouldn't be done.
<snip/>
> I don't care to check it ... the fact that the SI unit involves 12
> decimal places whereas the imperial unit involves 3 tells me the
> conversion probably shouldn't be done in a program that wants
> accuracy.
Your comment is absurd for multiple reasons. As we are focusing on the computational aspect of
this issue then I will only say this: If we are dealing with a computer representation of numbers
then, as long as the numeric data type provides enough precision, it is perfectly irrelevant if a
decimal representation of a certain number involves 12 or 3 decimal places. The only precision
issues which affect a calculation is the ones arising from a) the ability to exactly represent a
certain number in a specific representation and b) the precision errors produced by arithmetic
operations.
Rui Maciel
More information about the Python-list
mailing list