ANN: dmath 0.9 - Math routines for the Decimal type

Brian Beck exogen at gmail.com
Mon Sep 25 23:03:59 CEST 2006


Hi all,

I'm pleased to announce the first release of my new library, dmath. It is
available under the MIT/X11 license.


Download
========
Cheese Shop: http://cheeseshop.python.org/pypi/dmath/0.9
Google Code: http://code.google.com/p/dmath/


What is dmath?
==============
dmath provides the standard math routines for Python's arbitrary-precision
Decimal type. These include acos, asin, atan, atan2, ceil, cos, cosh,
degrees, e, exp, floor, golden_ratio, hypot, log, log10, pi, pow, radians,
sign, sin, sinh, sqrt, tan, and tanh.


How is it different from decimalfuncs?
======================================
dmath has the complete set of math routines (not just a
subset), it's faster (from what I can tell), doesn't require its own
precision-setting method, and is MIT instead of GPL licensed.


About this release:
===================
This is the first release and I'm calling this release 0.9 because it just
needs some testing and maybe some speed improvements, otherwise it's ready
to use. There is currently some work being done in Python sandbox/trunk to
convert the decimal module to C, and maybe they'll include fast versions of
all these routines.

You can follow development details and announcements on my blog here:
http://blog.case.edu/bmb12/


How do I use it?
=================
Use it just like math and cmath, but make sure you give it Decimals:

>>> from dmath import *
>>> from decimal import Decimal as D, getcontext
>>> getcontext().prec = 50
>>> asin(D(1))
Decimal("1.5707963267948966192313216916397514420985846996876")
>>> golden_ratio()
Decimal("1.6180339887498948482045868343656381177203091798058")

-- 
Brian Beck
Adventurer of the First Order


More information about the Python-announce-list mailing list