Data structure recommendation?

Tim Roberts timr at
Thu Apr 10 07:37:35 CEST 2008

"Steven Clark" <steven.p.clark at> wrote:
>Thanks for the reply. Can you explain how I could be bitten by
>floating point precision here?
>I'm familiar with how&why 1.3*3 != 3.9, etc., but I'm not sure how it
>applies here, or what you are gaining by converting to int.

Well, it depends on how you get your floating point numbers.  I assume you
won't be using hard-coded floating point constants as your indices.
Instead, you'll be computing them from data in files from somewhere. That's
where you have the opportunity to have one index that is 1.6-0.4 and one
index that is 0.8+0.4, and the two won't be the same.
Tim Roberts, timr at
Providenza & Boekelheide, Inc.

More information about the Python-list mailing list