On 29/08/12 21:20, damjan kuzmic wrote:
Hello,
i would like to know how to write a formula that in excell looks like this:

A / EXP(-LN(2) * t)


Start by breaking it down from the inside out.

LN(2) is log(2) in Python, which is found in the math module so you need
import math too.

negation ( -LN() ) and multiplication are builtin (* t)

EXP() is exp(), also in the math module.

division is built in (although I'm not sure if Excel / is integer
or 'real' division, given the nature of the values I'll assume its real...

So the final expression should look like

import math
...
value = A/math.exp(-math.log(2) * t)

Which isn't too different to Excel.


--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to