ideas for the best way to do some math, please??

Ben Carrington bjc32 at hermes.cam.ac.uk
Tue Apr 16 09:16:41 EDT 2002


i am a complete beginner with python, please be gentle :I

i am trying to evaluate a reatively simple equation but i keep getting
this error:

overflowError: math range error

...pointing to math.log(p)
        ...
        #part3
	part3 = 1 - math.e**part2
	p = abs(part3)

	#part4
	part4i = math.log(p)
	part4ii = k*T*part4i
        ...

...how can i pass the value of "p" into math.log() and avoid this
problem? what is the best way to structure an equation, divide into
functions, use more brackets?? I have use L for long integers at the
top of the code and this corrected problems with large and very small
powers of numbers...but i don't know how to work the L into
math.log....hope this makes sense

thanks in advance

Ben



More information about the Python-list mailing list