On Thu, 31 Dec 2009 at 10:13AM -0800, eliot brenner wrote: > Is there a way to make all floating point calculations within a > program or session occur to a fixed precision, say 500 digits? I know > how to issue commands like > > R500 = RealField(500) #set up 500 bit precision arithmetic > R500(pi) > > etc. for an individual calculation. But it would be preferable to be > able to issue a command that would result in all functions within the > program (such as sin, cos, etc.) evaluating to 500 bits precision, and > all intermediate steps being stored to 500 significant bits, and so > forth. The main reason is that I want the result of a complex program > to have a certain number of significant digits, and I am always afraid > that some rounding is occurring in some intermediate step. I want to > insure that no rounding occurs in an intermediate step, and also that > all functions evaluate to a fixed number of significant bits, without > any rounding occurring.
I don't know if it will completely meet all your needs, but mpmath is included with Sage and supports setting a precision -- see http://mpmath.googlecode.com/svn/trunk/doc/build/index.html Dan -- --- Dan Drake ----- http://mathsci.kaist.ac.kr/~drake -------
signature.asc
Description: Digital signature