python decimal library dmath.py v0.3 released

Mark H. Harris harrismh777 at gmail.com
Mon Mar 3 23:08:37 CET 2014


On Monday, March 3, 2014 3:18:37 PM UTC-6, Mark H. Harris wrote:

Yeah, you can set Emin & Emax enormously large (or small), can set
off overflow, and set clamping. 

I am needing a small utility (tk?) that will allow the context to be set
manually by the interactive user dynamically (for a particular problem).
Its like, one context doesn't fit all.  Some of the pdeclib funcs will need
to take into account the various signals also. 

The context manger is fabulous, but not for the average user; all the
try block stuff is encapsulated (which makes the coding clean) but it
is not obvious in any way what is happening with __init__() , __enter__()
and __exit__() (although I did find a couple of good articles on the
subject. The 'with localcontext(cts=None) as ctx' is genius, but not
for the average user who just wants to get work done with python.

So, the bottom line is we have this fabulous speedy decimal module
that is nothing short of wonderful for experts, and completely out
of the grasp of average users relatively new to python or with 
limited experience with decimal floating point arithmetic. "They would
like to sing soft and sweet, like the cucumber, but they can't!"

So, we need a complete wrapper around the decimal module (or better
yet we need to make decimal floating point default) so that average 
users may take advantage of precise floating point math without 
having to be experts on decimal floating point arithmetic constraints
in the new high speed module.    :-}

marcus
 



More information about the Python-list mailing list