standard power operation (**) in Python does not work for negative power! Sure I could write the formula otherwise, with divide and positive power. However, I am checking optimization routine result, and sometimes power is negative, sometimes it is positive. Here again a if statement could do, but I am wondering if there is a workarouns and a Python library where negative exposant is allowed.
Thanks and Regards.
standard power operation ( ** ) in Python does not work for negative power!
Share
Which version of python are you using? Perfectly works for me in Python 2.6, 2.7 and 3.2:
and with numpy 1.6.1: