In [1]:
import math

In [2]:
print(math.e)


2.718281828459045

In [3]:
print(2**4)


16

In [4]:
print(pow(2, 4))


16

In [5]:
print(math.pow(2, 4))


16.0

In [6]:
print(pow(1 + 1j, 2))


2j

In [7]:
# print(math.pow(1 + 1j, 2))
# TypeError: can't convert complex to float

In [8]:
print(pow(2, 4, 5))


1

In [9]:
print(2**0.5)


1.4142135623730951

In [10]:
print(math.sqrt(2))


1.4142135623730951

In [11]:
print(2**0.5 == math.sqrt(2))


True

In [12]:
print((-3 + 4j)**0.5)


(1.0000000000000002+2j)

In [13]:
# print(math.sqrt(-3 + 4j))
# TypeError: can't convert complex to float

In [14]:
print((-1)**0.5)


(6.123233995736766e-17+1j)

In [15]:
# print(math.sqrt(-1))
# ValueError: math domain error

In [16]:
import cmath

print(cmath.sqrt(-3 + 4j))


(1+2j)

In [17]:
print(cmath.sqrt(-1))


1j

In [18]:
print(math.exp(2))


7.38905609893065

In [19]:
print(math.exp(2) == math.e**2)


False

In [20]:
print(math.log(25, 5))


2.0

In [21]:
print(math.log(math.e))


1.0

In [22]:
print(math.log10(100000))


5.0

In [23]:
print(math.log2(1024))


10.0