JavaScript exponents

There is an exponentiation operator, which is part of the ES7 final specification. It is supposed to work in a similar manner with python and matlab: Now it is already implemented in Edge14, Chrome52, and also it is available with traceur or babel.

Python division

You’re using Python 2.x, where integer divisions will truncate instead of becoming a floating point number. You should make one of them a float: or from __future__ import division, which the forces / to adopt Python 3.x’s behavior that always returns a float.