Numeric data question
Chris Barker
Chris.Barker at noaa.gov
Fri Jul 26 14:53:11 EDT 2002
terry wrote:
> I will have found out how to properly ask it.
That is the first step in a newsgroup...how do I ask my question?
> You're example is what is not acceptable (to the accounting
> community)
My example was just that, an example. It was not intended to be a decent
implimenation, just an example of how one could write such a class, and
an example of how such a class could interact with other Python numeric
types, which is how I read your original question. However, asside from
being very incomplete, I wander what was unacceptable about it? It used
python long integer micropennies for internal storage, so you would have
no floating point problems and unlimited size. Maybe not a well
optimized solution, but it sounds more accurate that what VB uses,
according to another poster's description.
Anyway, you would have some work to do, and have to know what you're
doing to do it right, maybe Tim Peters' FixedPoint class will fit your
needs (and Tim Peters does know what he is doing).
> I've also used routines that are based on
> strings and integers. They all share the common trait of being
> ugly.
If you wrote a python class that way, the uglyness would be hidden from
the user. Fortran did not offer that level of encapsulation.
Good luck,
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker at noaa.gov
More information about the Python-list
mailing list