Re: math module for Decimals

2008-12-28 Thread jerry . carl . mi
Hi Steven... thanks for your kind and extensive reply. Lots of good food for thought. I know it's easy to complain about lack of functionality, but it really was not my intention. Python is very cool as it is and I still know too little about it to even suggest anything. I just thought maybe I was

Re: math module for Decimals

2008-12-28 Thread jerry . carl . mi
- are you using Decimal for the base-10-ness or the   extra precision Decimal provides?  Or significant zeros?   Or compatibility with existing Decimal code, or what? Oh boy, now I will finally prove myself illiterate... well, so be it. But i am after the extra precision: from math import *

Re: math module for Decimals

2008-12-28 Thread jerry . carl . mi
1. mpmath? 2. sympy? 3. Sage? Haven't tried those, i guess i have some studying to do. x=Decimal.__mod__(x,Decimal('2')*pi()) Works fine for what i need, but i am sure it's not the right way to do it. I don't know of any better way to deal with large arguments. The main problem

Re: math module for Decimals

2008-12-28 Thread jerry . carl . mi
mpmath... wow... just did what i needed :-) Thanks, Mark! Hopefully i did not waste too much of your time... and perhaps this discussion will send other lost sheeps in the right direction. (Still, it would make sense to have the goniometric functions in decimal.) --

math module for Decimals

2008-12-27 Thread jerry . carl . mi
Hi, I have been looking for a Python module with math functions that would both eat and spit Decimals. The standard math module eats Decimals allright but spits floats... herefore exp(sin(Decimal())) produces exp () of a float :-( So far, i found: -AJDecimalMathAdditions

Re: math module for Decimals

2008-12-27 Thread jerry . carl . mi
Which math functions? ln, log10, exp, sqrt already exist as methods of   Decimal instances. At the end of the Decimal docs there are a few   examples, including computing sin and cos (but apparently they naïvely use   a McLaurin series like you noticed in other module). Hi Gabriel - thanks!