For money, you should probably use the builtin module 'decimal' instead: http://docs.python.org/library/decimal.html
There's also the third party module 'mpmath' which provides arbitrary precision floating point arithmetic. http://mpmath.googlecode.com/svn/trunk/doc/build/index.html -Modulok- On 2/6/12, Kapil Shukla <shukla.ka...@gmail.com> wrote: > i tried writing a small code to calculate option price using the binomial > tree model. I compared my results with results of the same program in > excel. There seems to be a minor difference due to decimal precision as > excel is using 15 decimal precision and python (both 2.7 and 3.1) using 11. > (at least that's what shown on shell) > > can some one guide me whats the equivalent of using a double datatype on > python and i can't use long() in 3.1 any more. > > Please also suggest a free editor for python which can at least repeat > previous command with a key stroke > > regards > kapil > _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor