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

William Park opengeometry at NOSPAM.yahoo.ca
Tue Apr 16 11:03:58 EDT 2002


Ben Carrington <bjc32 at hermes.cam.ac.uk> wrote:
> 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

Well, as you know, log(x) -> -infinity as x -> 0.  So, 'p' and 'part2' are
probably 0.

-- 
William Park, Open Geometry Consulting, <opengeometry at yahoo.ca>
8 CPU cluster, NAS, (Slackware) Linux, Python, LaTeX, Vim, Mutt, Tin



More information about the Python-list mailing list