[Python-Dev] calculator module (original) (raw)

Raymond Hettinger raymond.hettinger at verizon.net
Wed Mar 10 02:26:18 EST 2004


I was thinking that if a student's calculator can do something, then Python ought to handle most of the same tasks right out of the box.

For a while, we've held off on adding math functions because of several principles:

My thought is to create a pure python module with "pretty good" implementations of things found on low to mid-range calculators like my personal favorite, the hp32sII student scientific calculator. It offers a reasonably small but useful set of functions without any attempt to comprehensively cover a given category. For instance, there is a single, simple solver -- and if it can't handle your function, then you go to MatLab or somesuch.

Here are a few that may be worthy of a module:

Another variant of the calculator also offers:

To these, the HP12C financial calculator adds:

Though not present on the calculator, I could also see the inclusion of probability distributions to capture what students normally have to look up in tables and then can't find when they need it. That is likely why MS Excel includes these functions but excludes so many others.

By "pretty good" implementation, I mean that the implementations should remain as straight-forward as possible and neither promise, nor get in a snit about being accurate to the last place (i.e. a 9 place approximation of gamma would be considered fine).

Raymond Hettinger



More information about the Python-Dev mailing list